Skip to content

Commit 42595d0

Browse files
committed
add missing sample, format samples
1 parent 96288a5 commit 42595d0

File tree

6 files changed

+48
-21
lines changed

6 files changed

+48
-21
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```dart {3}
22
await 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
```
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
```
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
```dart
1+
```dart {7}
22
FutureOr<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
```
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
```dart
1+
```dart {9}
22
FutureOr<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
```
Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
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
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
```

0 commit comments

Comments
 (0)