createZoneSpecification method

ZoneSpecification createZoneSpecification()

Configure a Zone for handling uncaught asynchronous errors

Implementation

ZoneSpecification createZoneSpecification() {
  return ZoneSpecification(
      handleUncaughtError: (Zone self, ZoneDelegate parent, Zone zone, Object error, StackTrace stackTrace) {
    handleError(error, stackTrace, source: 'Zone');
    // Allow normal Zone processing too
    parent.handleUncaughtError(zone, error, stackTrace);
  });
}