Dart Documentationangular.coreExceptionHandler

ExceptionHandler class

Any uncaught exception in angular expressions is delegated to this service. The default implementation logs exceptions into console.

In your application it is expected that this service is overridden with your implementation which can store the exception for later processing.

class ExceptionHandler {

/**
 * Delegate uncaught exception for central error handling.
 *
 * - [error] The error which was caught.
 * - [stack] The stacktrace.
 * - [reason] Optional contextual information for the error.
 */
 call(dynamic error, dynamic stack, [String reason = '']){
   print("$error\n$reason\nSTACKTRACE:\n$stack");
 }
}

Subclasses

LoggingExceptionHandler, RethrowExceptionHandler

Methods

dynamic call(error, stack, [String reason = '']) #

Delegate uncaught exception for central error handling.

  • error The error which was caught.
  • stack The stacktrace.
  • reason Optional contextual information for the error.
call(dynamic error, dynamic stack, [String reason = '']){
 print("$error\n$reason\nSTACKTRACE:\n$stack");
}