ExceptionStackTraceExtractor<T> class abstract

Sentry handles Error.stackTrace by default. For other cases extend this abstract class and return a custom StackTrace of your exceptions.

Implementing an extractor and providing it through SentryOptions.addExceptionStackTraceExtractor will enable the framework to extract the inner stacktrace and add it to SentryException when no other stacktrace was provided while capturing the event.

For an example on how to use the API refer to dio/DioStackTraceExtractor or the code below:

class ExceptionWithInner {
  ExceptionWithInner(this.innerException, this.innerStackTrace);
  Object innerException;
  dynamic innerStackTrace;
}

class ExceptionWithInnerStackTraceExtractor extends ExceptionStackTraceExtractor<ExceptionWithInner>  {
  @override
  dynamic cause(ExceptionWithInner error) {
    return error.innerStackTrace;
  }
}

options.addExceptionStackTraceExtractor(ExceptionWithInnerStackTraceExtractor());

Properties

exceptionType Type
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stackTrace(T error) → dynamic
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited