I try to find any solution to send non fatal exception on iOS with crashlytics service. Is that possible? How to achieve this?
            Asked
            
        
        
            Active
            
        
            Viewed 4,186 times
        
    6
            
            
        - 
                    2There's no such thing as a non-fatal crash. But if you catch a catchable exception in a try-catch block, you can do whatever you want with the caught NSException instance. – rmaddy Mar 27 '15 at 02:52
 - 
                    @rmaddy O thank you. but could you provide any code examples? – Mustafa Mar 27 '15 at 07:55
 - 
                    Find some Objective-C tutorials that cover exception handling using `@try/@catch`. – rmaddy Mar 27 '15 at 14:03
 - 
                    Possible duplicate of [Crashlytics iOS - log caught exception](http://stackoverflow.com/questions/23118742/crashlytics-ios-log-caught-exception) – Mike Bonnell Apr 13 '16 at 20:38
 
2 Answers
2
            
            
        https://docs.fabric.io/apple/crashlytics/logged-errors.html
Using the API You can record an NSError using this API:
[CrashlyticsKit recordError:error];
Crashlytics.sharedInstance().recordError(error)
        Chris Horsfield
        
- 153
 - 9
 
1
            
            
        Crashlytics introduced this functionality in Jan 2016 and published this blog post: https://www.crashlytics.com/blog/introducing-the-ability-to-log-nserrors
Implementation Details:
https://docs.fabric.io/ios/crashlytics/logged-errors.html
Very similar to what Crashlytics provides for Android where you have to use try/catch: http://support.crashlytics.com/knowledgebase/articles/202805-logging-caught-exceptions
Crashlytics also talks about why they do not support NSException, but NSError instead.
Answering an old question in case someone stumbles upon it as I did! :)
        rkwatra
        
- 195
 - 1
 - 3