File tree 4 files changed +13
-10
lines changed
4 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## Unreleased
4
+
5
+ ### Fixes
6
+
7
+ - Capture Future errors for Flutter Web automatically ([ #1143 ] ( https://github.com/getsentry/sentry-dart/pull/1143 ) )
8
+
3
9
## 6.16.1
4
10
5
11
### Fixes
Original file line number Diff line number Diff line change @@ -60,11 +60,6 @@ class FlutterErrorIntegration extends Integration<SentryFlutterOptions> {
60
60
final mechanism = Mechanism (
61
61
type: 'FlutterError' ,
62
62
handled: true ,
63
- data: {
64
- if (flutterErrorDetails.isNotEmpty)
65
- 'hint' :
66
- 'See "flutter_error_details" down below for more information'
67
- },
68
63
);
69
64
final throwableMechanism = ThrowableMechanism (mechanism, exception);
70
65
Original file line number Diff line number Diff line change @@ -52,7 +52,13 @@ mixin SentryFlutter {
52
52
53
53
final platformDispatcher = PlatformDispatcher .instance;
54
54
final wrapper = PlatformDispatcherWrapper (platformDispatcher);
55
- final isOnErrorSupported = wrapper.isOnErrorSupported (flutterOptions);
55
+
56
+ // Flutter Web don't capture [Future] errors if using [PlatformDispatcher.onError] and not
57
+ // the [runZonedGuarded].
58
+ // likely due to https://github.com/flutter/flutter/issues/100277
59
+ final isOnErrorSupported = flutterOptions.platformChecker.isWeb
60
+ ? false
61
+ : wrapper.isOnErrorSupported (flutterOptions);
56
62
57
63
// first step is to install the native integration and set default values,
58
64
// so we are able to capture future errors.
Original file line number Diff line number Diff line change @@ -56,8 +56,6 @@ void main() {
56
56
final throwableMechanism = event.throwableMechanism as ThrowableMechanism ;
57
57
expect (throwableMechanism.mechanism.type, 'FlutterError' );
58
58
expect (throwableMechanism.mechanism.handled, true );
59
- expect (throwableMechanism.mechanism.data['hint' ],
60
- 'See "flutter_error_details" down below for more information' );
61
59
expect (throwableMechanism.throwable, exception);
62
60
63
61
expect (event.contexts['flutter_error_details' ]['library' ], 'sentry' );
@@ -92,8 +90,6 @@ void main() {
92
90
final throwableMechanism = event.throwableMechanism as ThrowableMechanism ;
93
91
expect (throwableMechanism.mechanism.type, 'FlutterError' );
94
92
expect (throwableMechanism.mechanism.handled, true );
95
- expect (throwableMechanism.mechanism.data['hint' ],
96
- 'See "flutter_error_details" down below for more information' );
97
93
98
94
expect (event.contexts['flutter_error_details' ]['library' ], 'sentry' );
99
95
expect (event.contexts['flutter_error_details' ]['context' ],
You can’t perform that action at this time.
0 commit comments