File tree Expand file tree Collapse file tree 2 files changed +23
-19
lines changed
user-feedback/sdk-api-example Expand file tree Collapse file tree 2 files changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -6,17 +6,19 @@ class MyRpcException implements Exception {
66 MyRpcException(this.function, this.httpStatusCode);
77}
88
9- await Sentry.init((options) {
10- options.beforeSend = (event, hint) {
11- if (event.throwable is MyRpcException) {
12- final exception = event.throwable as MyRpcException;
13- event = event.copyWith(fingerprint: [
14- '{{ default }}',
15- exception.function,
16- exception.httpStatusCode.toString(),
17- ]);
18- }
19- return event;
20- };
21- };
9+ await Sentry.init(
10+ (options) {
11+ options.beforeSend = (event, hint) {
12+ if (event.throwable is MyRpcException) {
13+ final exception = event.throwable as MyRpcException;
14+ event = event.copyWith(fingerprint: [
15+ '{{ default }}',
16+ exception.function,
17+ exception.httpStatusCode.toString(),
18+ ]);
19+ }
20+ return event;
21+ };
22+ },
23+ );
2224```
Original file line number Diff line number Diff line change 22// Option 1: Retrieving SentryId from beforeSend
33SentryId sentryId = SentryId.empty();
44
5- await Sentry.init((options) {
6- options.beforeSend = (event, hint) {
7- sentryId = event.eventId;
8- return event;
9- };
10- });
5+ await Sentry.init(
6+ (options) {
7+ options.beforeSend = (event, hint) {
8+ sentryId = event.eventId;
9+ return event;
10+ };
11+ },
12+ );
1113
1214// Option 2: Retrieving SentryId from the method capturing the event
1315SentryId sentryId = Sentry.captureMessage("My message");
You can’t perform that action at this time.
0 commit comments