Provides a hook for centralized exception handling.

The default implementation of ExceptionHandler prints error messages to the Console. To intercept error handling, write a custom exception handler that replaces this default as appropriate for your app.

Example


class MyExceptionHandler implements ExceptionHandler {
  call(error, stackTrace = null, reason = null) {
    // do something with the exception
  }
}
 
bootstrap(MyApp, [provide(ExceptionHandler, {useClass: MyExceptionHandler})])
 

Static Methods

exceptionToString(exception, [ stackTrace = null, String reason = null ]) → String

Constructors

ExceptionHandler(_logger, [ bool _rethrowException = true ])

Properties

hashCode → int

Get a hash code for this object.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

call(exception, [ stackTrace = null, String reason = null ]) → void

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() → String

Returns a string representation of this object.

inherited