Skip to content

Commit

Permalink
Merge pull request #12 from matsuyani556/fix/patapata-sentry-exception
Browse files Browse the repository at this point in the history
Fix/patapata sentry exception
  • Loading branch information
matsuyani556 authored May 17, 2024
2 parents 479e176 + c0575bf commit 79675cb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/patapata_sentry/lib/patapata_sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ class SentryPlugin extends Plugin {
return null;
}

if (event.level == null) {
return event;
}

// Align the Sentry logging level to the app logging level.
if (_sentryLevelToLoggingLevel(event.level!) < app.log.level) {
return null;
Expand All @@ -105,6 +109,10 @@ class SentryPlugin extends Plugin {
return null;
}

if (breadcrumb.level == null) {
return breadcrumb;
}

// Align the Sentry logging level to the app logging level.
if (_sentryLevelToLoggingLevel(breadcrumb.level!) < app.log.level) {
return null;
Expand Down Expand Up @@ -176,7 +184,7 @@ class SentryPlugin extends Plugin {
final tMechanism = Mechanism(type: record.mechanism, handled: true);
final tError = record.error;

tExtra['patapataReportRecord'] = record;
tExtra['patapataReportRecord'] = record.toString();

if (record.mechanism == Log.kNativeMechanism && tError is NativeThrowable) {
tException = SentryException(
Expand Down

0 comments on commit 79675cb

Please sign in to comment.