Skip to content

Commit c1bb00f

Browse files
Log errors from PlatformDispatcher (#1257)
Co-authored-by: Manoel Aranda Neto <5731772+marandaneto@users.noreply.github.com> Fixes #1255
1 parent 8fa3934 commit c1bb00f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

flutter/lib/src/integrations/on_error_integration.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ class OnErrorIntegration implements Integration<SentryFlutterOptions> {
4141
_defaultOnError = wrapper.onError;
4242

4343
_integrationOnError = (Object exception, StackTrace stackTrace) {
44+
_options!.logger(
45+
SentryLevel.error,
46+
"Uncaught Platform Error",
47+
logger: 'sentry.platformError',
48+
exception: exception,
49+
stackTrace: stackTrace,
50+
);
51+
4452
final handled = _defaultOnError?.call(exception, stackTrace) ?? true;
4553

4654
// As per docs, the app might crash on some platforms

0 commit comments

Comments
 (0)