Dart API Referencedart:coreFutureUnhandledException

FutureUnhandledException class

Wraps unhandled exceptions provided to Completer.completeException. It is used to show both the error message and the stack trace for unhandled exceptions.

class FutureUnhandledException implements Exception {
  /** Wrapped exception. */
  var source;

  /** Trace for the wrapped exception. */
  Object stackTrace;

  FutureUnhandledException(this.source, this.stackTrace);

  String toString() {
    return 'FutureUnhandledException: exception while executing Future\n  '
        '${source.toString().replaceAll("\n", "\n  ")}\n'
        'original stack trace:\n  '
        '${stackTrace.toString().replaceAll("\n","\n  ")}';
  }
}

Implements

Exception

Constructors

new FutureUnhandledException(source, Object stackTrace) #

FutureUnhandledException(this.source, this.stackTrace);

Properties

var source #

Wrapped exception.

var source;

Object stackTrace #

Trace for the wrapped exception.

Object stackTrace;

Methods

String toString() #

Returns a string representation of this object.

docs inherited from Object
String toString() {
  return 'FutureUnhandledException: exception while executing Future\n  '
      '${source.toString().replaceAll("\n", "\n  ")}\n'
      'original stack trace:\n  '
      '${stackTrace.toString().replaceAll("\n","\n  ")}';
}