File tree Expand file tree Collapse file tree 6 files changed +48
-21
lines changed
breadcrumbs/before-breadcrumb Expand file tree Collapse file tree 6 files changed +48
-21
lines changed Original file line number Diff line number Diff line change 11``` dart {3}
22await SentryFlutter.init(
3- (options) {
4- options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
5- },
6- );
3+ (options) {
4+ options.allowUrls = ["^https://sentry.com.*\$", "my-custom-domain"];
5+ },
6+ );
77```
Original file line number Diff line number Diff line change 1+ ``` dart {10}
2+ FutureOr<SentryEvent?> beforeSend(SentryEvent event, Hint hint) async {
3+ if (event.throwable is DatabaseException) {
4+ event = event.copyWith(fingerprint: ['database-connection-error']);
5+ }
6+ return event;
7+ }
8+
9+ await Sentry.init(
10+ (options) {
11+ options.beforeSend = beforeSend;
12+ },
13+ );
14+ ```
Original file line number Diff line number Diff line change 1- ``` dart
1+ ``` dart {7}
22FutureOr<SentryEvent?> beforeSend(SentryEvent event, Hint hint) async {
33 return hint is MyHint ? null : event;
44}
55
6- await SentryFlutter.init((options) => options.beforeSend = beforeSend);
6+ await SentryFlutter.init(
7+ (options) {
8+ options.beforeSend = beforeSend;
9+ },
10+ );
711```
Original file line number Diff line number Diff line change 1- ``` dart
1+ ``` dart {9}
22FutureOr<SentryEvent?> beforeSend(SentryEvent event, Hint hint) async {
33 // Modify the event here:
44 event = event.copyWith(serverName: null); // Don't send server names.
55 return event;
66}
77
8- await SentryFlutter.init((options) => options.beforeSend = beforeSend);
8+ await SentryFlutter.init(
9+ (options) {
10+ options.beforeSend = beforeSend;
11+ },
12+ );
913```
Original file line number Diff line number Diff line change 1- ``` dart
2- import 'package:flutter/widgets.dart';
3- import 'package:sentry_flutter/sentry_flutter.dart';
4-
5- Future<void> main() async {
6- await SentryFlutter.init(
7- (options) {
8- options.dsn = '___PUBLIC_DSN___';
9- options.attachViewHierarchy = true;
10- },
11- appRunner: () => runApp(MyApp()),
12- );
13- }
1+ ``` dart {3}
2+ await SentryFlutter.init(
3+ (options) {
4+ options.attachViewHierarchy = true;
5+ },
6+ appRunner: () => runApp(MyApp()),
7+ );
148```
Original file line number Diff line number Diff line change 1+ ``` dart {7}
2+ Breadcrumb? beforeBreadcrumb(Breadcrumb? breadcrumb, Hint hint) {
3+ return 'a.spammy.Logger' == breadcrumb.category ? null : breadcrumb;
4+ }
5+
6+ await SentryFlutter.init(
7+ (options) {
8+ options.beforeBreadcrumb = beforeBreadcrumb;
9+ },
10+ );
11+ ```
You can’t perform that action at this time.
0 commit comments