Error handling improvements

This commit is contained in:
Yegor Vialov
2020-05-01 16:24:13 +00:00
parent 7a0ce93cfd
commit 46ca1948e2
8 changed files with 24 additions and 25 deletions

View File

@ -163,7 +163,7 @@ const appVersion = "$appVersionNumber-$appVersionAdd";
Future<void> _reportError(dynamic error, dynamic stackTrace) async {
// Print the exception to the console.
if (Logger.isInDebugMode) {
Logger.e('Caught error: $error');
Logger.e('Caught error: $error', skipCrashlytics: true);
Logger.p(stackTrace);
}
Crashlytics.instance.recordError(error, stackTrace);
@ -175,7 +175,7 @@ void main() async {
SyncfusionLicense.registerLicense(secrets['syncfusion_license_key']);
FlutterError.onError = (FlutterErrorDetails details) {
Logger.e("Caut Flutter runtime error: ${details.exception}");
Logger.e("Caut Flutter runtime error: ${details.exception}", skipCrashlytics: true);
if (Logger.isInDebugMode) {
FlutterError.dumpErrorToConsole(details);
}