-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inner and suppressed exception support on Android
- Loading branch information
Konrad Dysput
committed
Nov 28, 2024
1 parent
21f00b2
commit c3b79fb
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -314,6 +314,32 @@ try { | |
</TabItem> | ||
</Tabs> | ||
|
||
### Sending Inner and Suppressed exceptions | ||
|
||
:::warning Inner and suppressed exception support | ||
|
||
The new inner and suppressed exception support is available starting [email protected] | ||
Check warning on line 321 in docs/error-reporting/platform-integrations/android/configuration.md GitHub Actions / vale[vale] docs/error-reporting/platform-integrations/android/configuration.md#L321
Raw output
|
||
::: | ||
|
||
Backtrace clients allow sending Inner and suppressed exceptions. By default, this option is disabled. To enable inner and suppressed exception support, use the code shown below. | ||
|
||
```java | ||
// enable inner exceptions | ||
backtraceClient.sendInnerExceptions(true); | ||
// enable suppressed exceptions | ||
backtraceClient.sendSuppressedExceptions(true); | ||
``` | ||
|
||
Once inner or suppressed exceptions are enabled, The Backtrace client will verify the `BacktraceReport` or `exception` object passed to the `send` method. If inner/suppressed exceptions are detected, the report with the same attributes will be created for each. In addition to that, the following attributes will be generated: | ||
|
||
| Attribute name | Attribute description | | ||
| -------------- | ----------------------------------------------------------------------------------- | | ||
| error.trace | Exception trace id. All exceptions in the exception chain will have the same value. | | ||
| error.id | Current report identifier. The value is allows to identify the current report id | | ||
| error.parent | Parent report id. Allows to identify the exception parent id | | ||
|
||
The outer exception always has `error.trace` and `error.id`. Since this is the first error in the exception chain, the `error.parent` attribute is set to `null`. The first inner exception of the outer exception will have the same `error.trace` attribute, its own unique `error.id` attribute, and `error.parent` set to the outer exception `error.id`. Each suppressed exception of the outer exception, follows the same pattern. | ||
|
||
## Custom Event Handlers | ||
|
||
The `BacktraceClient` allows you to attach your custom event handlers. For example, you can trigger actions before the `send` method, as shown below. | ||
|