addOnError abstract method

void addOnError(
  1. BugsnagOnErrorCallback onError
)

Add a "on error" callback, to execute code at the point where an error report is captured in Bugsnag.

You can use this to add or modify information attached to an event before it is sent to your dashboard. You can also return false from any callback to prevent delivery.

bugsnag.addOnError((event) {
  event.severity = Severity.info;
  return true;
});

"on error" callbacks added here are only triggered for events originating in Dart and will always be triggered before "on error" callbacks added in the native layer (on Android and iOS).

Implementation

void addOnError(BugsnagOnErrorCallback onError);