-
Notifications
You must be signed in to change notification settings - Fork 205
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
Report internal SDK errors to bugsnag #570
Conversation
Rather than sending minimal error reports, the SDK now reports internal SDK errors to bugsnag instead in a way that does not route them to customer dashboards. A minimal report is generated which is not altered in callbacks and is not cached to disk.
…ag-android into internal-reporting
bugsnag-android-core/src/main/java/com/bugsnag/android/Client.java
Outdated
Show resolved
Hide resolved
bugsnag-android-core/src/main/java/com/bugsnag/android/Client.java
Outdated
Show resolved
Hide resolved
bugsnag-android-core/src/main/java/com/bugsnag/android/Client.java
Outdated
Show resolved
Hide resolved
8262e58
to
876e5b0
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.
Looks good and works as expected in my testing. 👍 For future proofing, I think the test could better reflect the case(s) we want to handle. A good rule would be that we (generally) shouldn't need to call an internal API from a functional test, though I recognize that there isn't a direct way to flush reports at the moment.
.../mazerunner/src/main/java/com/bugsnag/android/mazerunner/scenarios/InternalReportScenario.kt
Outdated
Show resolved
Hide resolved
1cce3bc
to
3a86807
Compare
I've updated the mazerunner scenario so that it now creates an empty file in the reports directory, which will trigger an internal error report. |
I tested the following permutations and all exhibited the expected outcomes:
|
Goal
Rather than sending minimal error reports, the SDK now reports internal SDK errors to bugsnag
instead in a way that does not route them to customer dashboards. A minimal report is generated
which is not altered in callbacks and is not cached to disk.
Changeset
ErrorStore
to inform a delegate of an exception, rather than creating an error from the filenameonErrorReadFailure()
to add metadata to a generated error about the file being read, and then report an internal error to bugsnagreportInternalBugsnagError()
, which sends an error report that is picked up by Bugsnag's internal monitoringNote: in order to alter the headers on a per-request basis,
DefaultDelivery
must be used as the delivery mechanism, as otherwise we'd need to make a breaking change to the delivery signature. If a user has specified a customDelivery
mechanism we're unable to send these reports. This API limitation has already been rectified in the immutable config work where we can specify different headers for individual requestsTests