Log uncaught exceptions

They are already being sent to Crashalytics, but I would still like to
log them in the debug log. It makes debugging everything much easier.
This commit is contained in:
Vishesh Handa
2019-06-02 15:17:55 +02:00
parent 8839540a5f
commit b5f5fdcd67

View File

@ -20,6 +20,8 @@ void main() async {
runZoned<Future<void>>(() async {
await JournalApp.main();
}, onError: (Object error, StackTrace stackTrace) async {
print("Uncaught Exception: " + error.toString());
print(stackTrace);
await FlutterCrashlytics()
.reportCrash(error, stackTrace, forceCrash: false);
});