Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Catch sentry errors when sending
  • Loading branch information
filiph committed Aug 29, 2019
commit 6c3ac3297864406ce9b5d069eac9966d1d2c0188
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,16 @@ main() async {
runZoned(
() => runApp(MyApp()),
onError: (Object error, StackTrace stackTrace) {
sentry.captureException(
exception: error,
stackTrace: stackTrace,
);
try {
sentry.captureException(
exception: error,
stackTrace: stackTrace,
);
print('Error sent to sentry.io: $error');
} catch (e) {
print('Sending report to sentry.io failed: $e');
print('Original error: $error');
}
},
);
```
Expand All @@ -76,7 +82,7 @@ main() async {
} catch (e) {
print('Sending report to sentry.io failed: $e');
} finally {
// Also use Flutter's default error logging to the device's console.
// Also use Flutter's pretty error logging to the device's console.
FlutterError.dumpErrorToConsole(details, forceReport: forceReport);
}
};
Expand Down