KeshaviPhone / plcrashreporter

Automatically exported from code.google.com/p/plcrashreporter
Other
0 stars 0 forks source link

Investigate support for generating live reports with a caught NSException #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
An integration parter has requested support for a method that allows passing in 
an NSException value:

- (NSData *) generateLiveReportWithException: (NSException *) exception error: 
(NSError **) outError;

This would mirror the existing uncaught exception handler, but would allow the 
application to catch and record exceptions without actually crashing.

There are some concerns with this, namely, Apple's Objective-C libraries 
(Foundation, UIKit, AppKit, et al) are not exception-safe, and do not wrap 
locks, allocations, etc in try/catch blocks. If an exception fires and walks up 
the stack, the program itself is in an unknown state. Third-party code (under 
advice from Apple) behaves similarly -- exceptions are just not supported in 
the ObjC broader ecosystem for anything other than recording a fatal program 
error.

Ideally we wouldn't encourage or support catching, recording a crash report, 
and then ignoring exceptions; if the exception represents a fatal error, then 
it should be percolating up to the top-level uncaught exception handler, where 
it will trigger program termination. One alternative way to handle this use 
case would be to expose the crash log writer API to integrators, such that they 
can directly record preferred information, while we avoid exposing API in the 
higher-level ObjC API that should not be used by most users.

Original issue reported on code.google.com by landon.j.fuller@gmail.com on 18 Apr 2013 at 3:51