-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track whether an error is handled/unhandled #164
Conversation
Source/BugsnagCrashReport.h
Outdated
@@ -60,7 +60,8 @@ NSString *_Nonnull BSGFormatSeverity(BSGSeverity severity); | |||
errorMessage:(NSString *_Nonnull)message | |||
configuration:(BugsnagConfiguration *_Nonnull)config | |||
metaData:(NSDictionary *_Nonnull)metaData | |||
severity:(BSGSeverity)severity; | |||
severity:(BSGSeverity)severity | |||
unhandled:(BOOL)unhandled; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this interface is public, we may want to add a second constructor to avoid making this a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've reverted the signature change here, as the extra parameter wasn't being used within the constructor, and any client calling this method will be passing a handled error.
Source/BugsnagCrashReport.m
Outdated
} else { // the event was unhandled. | ||
_eventHandledState = @{ | ||
@"unhandled": @YES, | ||
@"originalSeverity": BSGFormatSeverity(BSGSeverityWarning), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be error
? I'm not sure when this case would happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - I've updated this so that unhandled events default to a severity of Error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I left a few questions inline.
Source/BugsnagCrashReport.m
Outdated
NSString *reasonType = [BugsnagHandledState stringFromSeverityReason:self.handledState.calculateSeverityReasonType]; | ||
severityReason[@"type"] = reasonType; | ||
|
||
if (self.handledState.attrKey) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like attrValue
should be checked too, since a dict value can't be nil
bsg_kscrw_i_writeBinaryImages(writer, BSG_KSCrashField_BinaryImages); | ||
// Don't write the binary images for user reported crashes to improve performance | ||
if (crashContext->crash.threadTracingEnabled == true || | ||
crashContext->crash.crashType != BSG_KSCrashTypeUserReported) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling writing binary images will need to be behind a flag for unity -- we still need binary images for user reported issues on regular cocoa.
bsg_kscrw_i_writeError(writer, BSG_KSCrashField_Error, &crashContext->crash); | ||
// Don't write the threads for user reported crashes to improve performance | ||
if (crashContext->crash.threadTracingEnabled == true || | ||
crashContext->crash.crashType != BSG_KSCrashTypeUserReported) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
262d6e5
to
da26480
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
No description provided.