2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 02:05:29 +00:00

Add extra context information to sentry error reports

- Should help to track down bugs where stacktrace is missing information
- Adds some more error catching, too
This commit is contained in:
Oliver Walters
2022-05-12 22:46:12 +10:00
parent e47d88a4bb
commit c90a849a5a
5 changed files with 69 additions and 13 deletions

View File

@ -39,7 +39,15 @@ Future<void> main() async {
FlutterError.onError = (FlutterErrorDetails details) async {
// Ensure that the error gets reported to sentry!
await sentryReportError(details.exception, details.stack);
await sentryReportError(
"FlutterError.onError",
details.exception, details.stack,
context: {
"context": details.context.toString(),
"summary": details.summary.toString(),
"library": details.library ?? "null",
}
);
};
runApp(
@ -47,7 +55,7 @@ Future<void> main() async {
);
}, (Object error, StackTrace stackTrace) async {
sentryReportError(error, stackTrace);
sentryReportError("main.runZonedGuarded", error, stackTrace);
});
}