Skip to content

Commit 3a08510

Browse files
committed
change explicitly handled to unhandled
1 parent 408af89 commit 3a08510

File tree

4 files changed

+10
-12
lines changed

4 files changed

+10
-12
lines changed

dart/lib/src/run_zoned_guarded_integration.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ class RunZonedGuardedIntegration extends Integration<SentryOptions> {
4444
stackTrace: stackTrace,
4545
);
4646

47-
// runZonedGuarded doesn't crash the App.
48-
final mechanism = Mechanism(type: 'runZonedGuarded', handled: true);
47+
// runZonedGuarded doesn't crash the app, but is not handled by the user.
48+
final mechanism = Mechanism(type: 'runZonedGuarded', handled: false);
4949
final throwableMechanism = ThrowableMechanism(mechanism, exception);
5050

5151
final event = SentryEvent(

dart/lib/src/sentry_isolate.dart

+3-2
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ class SentryIsolate {
6969
stackTrace == null ? null : StackTrace.fromString(stackTrace),
7070
);
7171

72-
// Isolate errors don't crash the App.
73-
final mechanism = Mechanism(type: 'isolateError', handled: true);
72+
// Isolate errors don't crash the app, but is not handled by the user.
73+
final mechanism = Mechanism(type: 'isolateError', handled: false);
7474
final throwableMechanism = ThrowableMechanism(mechanism, throwable);
75+
7576
final event = SentryEvent(
7677
throwable: throwableMechanism,
7778
level: SentryLevel.fatal,

flutter/lib/src/integrations/flutter_error_integration.dart

+2-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,8 @@ class FlutterErrorIntegration implements Integration<SentryFlutterOptions> {
5454
stackTrace: errorDetails.stack,
5555
);
5656

57-
// FlutterError doesn't crash the App.
58-
final mechanism = Mechanism(
59-
type: 'FlutterError',
60-
handled: true,
61-
);
57+
// FlutterError doesn't crash the app, but is not handled by the user.
58+
final mechanism = Mechanism(type: 'FlutterError', handled: false);
6259
final throwableMechanism = ThrowableMechanism(mechanism, exception);
6360

6461
var event = SentryEvent(

flutter/test/integrations/flutter_error_integration_test.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void main() {
7070

7171
final throwableMechanism = event.throwableMechanism as ThrowableMechanism;
7272
expect(throwableMechanism.mechanism.type, 'FlutterError');
73-
expect(throwableMechanism.mechanism.handled, true);
73+
expect(throwableMechanism.mechanism.handled, false);
7474
expect(throwableMechanism.throwable, exception);
7575

7676
expect(event.contexts['flutter_error_details']['library'], 'sentry');
@@ -102,7 +102,7 @@ void main() {
102102

103103
final throwableMechanism = event.throwableMechanism as ThrowableMechanism;
104104
expect(throwableMechanism.mechanism.type, 'FlutterError');
105-
expect(throwableMechanism.mechanism.handled, true);
105+
expect(throwableMechanism.mechanism.handled, false);
106106

107107
expect(event.contexts['flutter_error_details']['library'], 'sentry');
108108
expect(event.contexts['flutter_error_details']['context'],
@@ -126,7 +126,7 @@ void main() {
126126

127127
final throwableMechanism = event.throwableMechanism as ThrowableMechanism;
128128
expect(throwableMechanism.mechanism.type, 'FlutterError');
129-
expect(throwableMechanism.mechanism.handled, true);
129+
expect(throwableMechanism.mechanism.handled, false);
130130
expect(throwableMechanism.mechanism.data['hint'], isNull);
131131

132132
expect(event.contexts['flutter_error_details'], isNull);

0 commit comments

Comments
 (0)