Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yarneo committed Apr 25, 2017
1 parent afc7df5 commit 160ed9c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Mixpanel/MixpanelExceptionHandler.m
Expand Up @@ -154,10 +154,20 @@ + (void) mp_handleUncaughtException:(NSException *)exception {
// Archive the values for each Mixpanel instance
for (Mixpanel *instance in handler.mixpanelInstances) {
[instance archive];
[instance track:@"App Crashed" properties:@{@"Reason": [exception reason],
@"Trace": [[exception userInfo] objectForKey:UncaughtExceptionHandlerAddressesKey]}];
NSMutableDictionary *properties = [[NSMutableDictionary alloc] init];
[properties setValue:[exception reason] forKey:@"Reason"];
[properties setValue:[[exception userInfo] objectForKey:UncaughtExceptionHandlerAddressesKey] forKey:@"Trace"];
[instance track:@"App Crashed" properties:properties];
dispatch_sync(instance.serialQueue, ^{});
}

NSSetUncaughtExceptionHandler(NULL);
signal(SIGABRT, SIG_DFL);
signal(SIGILL, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGBUS, SIG_DFL);
signal(SIGPIPE, SIG_DFL);
NSLog(@"Encountered an uncaught exception. All Mixpanel instances were archived.");

NSLog(@"%@", [NSString stringWithFormat:@"Debug details follow:\n%@\n%@",
Expand Down

0 comments on commit 160ed9c

Please sign in to comment.