-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
feat: add underlying error info to reported NSErrors #3230
Conversation
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
7192d9e | 1221.86 ms | 1248.28 ms | 26.42 ms |
7bb0873 | 1226.18 ms | 1247.30 ms | 21.12 ms |
6604dbb | 1248.35 ms | 1256.14 ms | 7.79 ms |
6943de0 | 1235.98 ms | 1246.88 ms | 10.90 ms |
fd6a31c | 1204.73 ms | 1222.34 ms | 17.61 ms |
257c2a9 | 1231.45 ms | 1252.12 ms | 20.67 ms |
d3630c3 | 1248.52 ms | 1262.70 ms | 14.18 ms |
e24290f | 1239.94 ms | 1248.28 ms | 8.34 ms |
4d68229 | 1233.50 ms | 1262.92 ms | 29.42 ms |
7ce3cf6 | 1217.98 ms | 1246.41 ms | 28.43 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
7192d9e | 20.76 KiB | 431.71 KiB | 410.95 KiB |
7bb0873 | 22.85 KiB | 407.09 KiB | 384.24 KiB |
6604dbb | 22.84 KiB | 402.56 KiB | 379.72 KiB |
6943de0 | 20.76 KiB | 393.33 KiB | 372.57 KiB |
fd6a31c | 20.76 KiB | 436.50 KiB | 415.74 KiB |
257c2a9 | 20.76 KiB | 401.36 KiB | 380.60 KiB |
d3630c3 | 22.84 KiB | 403.19 KiB | 380.34 KiB |
e24290f | 22.84 KiB | 403.51 KiB | 380.66 KiB |
4d68229 | 20.76 KiB | 432.34 KiB | 411.58 KiB |
7ce3cf6 | 22.85 KiB | 407.63 KiB | 384.78 KiB |
Previous results on branch: armcknight/feat/3063-add-underlying-error
Startup times
Revision | Plain | With Sentry | Diff |
---|---|---|---|
c4b6d45 | 1240.67 ms | 1259.48 ms | 18.81 ms |
4bb98a0 | 1230.71 ms | 1238.65 ms | 7.94 ms |
a7f5d45 | 1223.92 ms | 1249.50 ms | 25.58 ms |
8fa3bd8 | 1245.90 ms | 1273.12 ms | 27.22 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
c4b6d45 | 22.85 KiB | 407.53 KiB | 384.68 KiB |
4bb98a0 | 22.85 KiB | 407.98 KiB | 385.13 KiB |
a7f5d45 | 22.85 KiB | 411.18 KiB | 388.33 KiB |
8fa3bd8 | 22.84 KiB | 403.83 KiB | 380.99 KiB |
…es with XCTUnwrap)
…add-underlying-error
Codecov Report
@@ Coverage Diff @@
## main #3230 +/- ##
=============================================
+ Coverage 89.187% 89.251% +0.063%
=============================================
Files 500 500
Lines 54520 54555 +35
Branches 19568 19585 +17
=============================================
+ Hits 48625 48691 +66
+ Misses 5028 5002 -26
+ Partials 867 862 -5
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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.
According to the docs the correct way to report underlying errors is to add them to the event exception array.
The Exception Interface has no underlying_errors
property.
This comment was marked as outdated.
This comment was marked as outdated.
Thanks for pointing me to this @brustolin! The pertinent part seems to be:
|
…add-underlying-error
… events in asending temporal order
guard let mechanism = exception.mechanism else { | ||
XCTFail("Exception doesn't contain a mechanism"); return | ||
} | ||
|
||
let mechanism = try XCTUnwrap(exception.mechanism) | ||
let meta = try XCTUnwrap(mechanism.meta) | ||
let actualError = try XCTUnwrap(meta.error) | ||
XCTAssertEqual("NSError", mechanism.type) | ||
XCTAssertNotNil(mechanism.meta?.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 gives us a more granular idea of which thing is missing; It is responsible for all of the throws
additions in this file.
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.
LGTM
📜 Description
Refactor SentryNSError to accept just the NSError instance in init, and don't expose properties that aren't used outside of its implementation.
Then, wrap all underlying errors in SentryNSError and serialize them.
💡 Motivation and Context
#3063
💚 How did you test it?
📝 Checklist
You have to check all boxes before merging:
sendDefaultPII
is enabled.🔮 Next steps