addOnError

open fun addOnError(@NonNull onError: OnErrorCallback)

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. "on error" callbacks do not run before reports generated in the event of immediate app termination from crashes in C/C++ code.

For example:

Bugsnag.addOnError(new OnErrorCallback() { public boolean run(Event event) { event.setSeverity(Severity.INFO); return true; } })

Parameters

onError

a callback to run before sending errors to Bugsnag

See also