flutter_appcenter_bundle icon indicating copy to clipboard operation
flutter_appcenter_bundle copied to clipboard

Running app in error zone

Open markst opened this issue 3 years ago • 3 comments

Struggling to find much documentation on correct way of catching Flutter app errors.

Here's what I have:

void main() async {
  runZonedGuarded<Future<void>>(() async {
    FlutterError.onError =
        (details) => AppCenter.trackErrorAsync(details.exceptionAsString());

    WidgetsFlutterBinding.ensureInitialized();

    await AppCenter.startAsync(
      appSecretAndroid: 'xx',
      appSecretIOS: 'xxx',
      enableCrashes: true, // Defaults to true
    );

    runApp(App());
  },
      (error, stackTrace) =>
          Zone.current.handleUncaughtError(error, stackTrace));
}

markst avatar Apr 22 '22 12:04 markst

Here's relevant gist: https://gist.github.com/fredgrott/0e51f220fd27fa54f1b51d522a499902

markst avatar Apr 22 '22 12:04 markst

https://github.com/flutter/flutter/issues/44407

markst avatar Apr 22 '22 12:04 markst

Is any of the above necessary, or handled implicitly by configureCrashesAsync?

markst avatar Apr 22 '22 12:04 markst