From b5f5fdcd6773fde8f468f9ae518f4b48705c70da Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Sun, 2 Jun 2019 15:17:55 +0200 Subject: [PATCH] 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. --- lib/main.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/main.dart b/lib/main.dart index 3d59ba74..38e11eab 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -20,6 +20,8 @@ void main() async { runZoned>(() async { await JournalApp.main(); }, onError: (Object error, StackTrace stackTrace) async { + print("Uncaught Exception: " + error.toString()); + print(stackTrace); await FlutterCrashlytics() .reportCrash(error, stackTrace, forceCrash: false); });