Created
March 5, 2021 10:34
-
-
Save madmag77/fd58e2ea2b21750d249ac817e60f41d3 to your computer and use it in GitHub Desktop.
[Dart article] Unhandled Exceptions in Flutter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
WidgetsFlutterBinding.ensureInitialized(); | |
FlutterError.onError = (FlutterErrorDetails errorDetails) { | |
print("onError Exception: $errorDetails was caught by Flutter framework - redirect to Sentry or Firebase."); | |
}; | |
runZonedGuarded(() { | |
createProviders(); | |
runApp(MyApp()); | |
}, (e, s) { | |
print( | |
"Synchronous or Asynchronous Exception: $e (stack $s) was caught in our custom zone - redirect to Sentry or Firebase."); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment