Skip to content

Commit

Permalink
Renamed kCountlyExceptionUserInfoBacktraceKey
Browse files Browse the repository at this point in the history
  • Loading branch information
erkanyildiz committed Jun 15, 2016
1 parent 1c42942 commit 4202088
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions CountlyCrashReporter.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
@interface CountlyCrashReporter ()
@end

NSString* const kCountlyExceptionUserInfoBacktraceKey = @"kCountlyExceptionUserInfoBacktraceKey";

@implementation CountlyCrashReporter

#if TARGET_OS_IOS
Expand All @@ -31,8 +33,6 @@ - (instancetype)init
return self;
}

#define kCountlyCrashUserInfoKey @"kCountlyCrashUserInfoKey"

- (void)startCrashReporting
{
NSSetUncaughtExceptionHandler(&CountlyUncaughtExceptionHandler);
Expand Down Expand Up @@ -90,7 +90,7 @@ void CountlyExceptionHandler(NSException *exception, bool nonfatal)
if(CountlyCustomCrashLogs)
crashReport[@"_logs"] = [CountlyCustomCrashLogs componentsJoinedByString:@"\n"];

NSArray* stackArray = exception.userInfo[kCountlyCrashUserInfoKey];
NSArray* stackArray = exception.userInfo[kCountlyExceptionUserInfoBacktraceKey];
if(!stackArray) stackArray = exception.callStackSymbols;

NSMutableString* stackString = NSMutableString.string;
Expand Down Expand Up @@ -172,10 +172,9 @@ void CountlySignalHandler(int signalCode)

free(lines);

NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObject:@(signalCode) forKey:@"signal_code"];
[userInfo setObject:backtrace forKey:kCountlyCrashUserInfoKey];
NSString *reason = [NSString stringWithFormat:@"App terminated by SIG%@",[NSString stringWithUTF8String:sys_signame[signalCode]].uppercaseString];

NSMutableDictionary *userInfo = @{@"signal_code":@(signalCode)}.mutableCopy;
userInfo[kCountlyExceptionUserInfoBacktraceKey] = backtrace;
NSString *reason = [NSString stringWithFormat:@"App terminated by SIG%@", [NSString stringWithUTF8String:sys_signame[signalCode]].uppercaseString];
NSException *e = [NSException exceptionWithName:@"Fatal Signal" reason:reason userInfo:userInfo];

CountlyUncaughtExceptionHandler(e);
Expand Down

0 comments on commit 4202088

Please sign in to comment.