Skip to content

Commit

Permalink
Log errors from PlatformDispatcher (#1257)
Browse files Browse the repository at this point in the history
Co-authored-by: Manoel Aranda Neto <[email protected]>
Fixes #1255
  • Loading branch information
maBarabas authored Jan 31, 2023
1 parent 8fa3934 commit c1bb00f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flutter/lib/src/integrations/on_error_integration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ class OnErrorIntegration implements Integration<SentryFlutterOptions> {
_defaultOnError = wrapper.onError;

_integrationOnError = (Object exception, StackTrace stackTrace) {
_options!.logger(
SentryLevel.error,
"Uncaught Platform Error",
logger: 'sentry.platformError',
exception: exception,
stackTrace: stackTrace,
);

final handled = _defaultOnError?.call(exception, stackTrace) ?? true;

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

0 comments on commit c1bb00f

Please sign in to comment.