runGuarded static method

void runGuarded(
  1. void appRunner()
)

Runs the app callback within a guarded zone to capture all unhandled asynchronous errors.

Implementation

static void runGuarded(void Function() appRunner) {
  runZonedGuarded(appRunner, (error, stack) {
    scheduleMicrotask(() {
      _captureException(error, stack);
    });
  });
}