ExceptionCauseExtractor<T> class abstract

Extend this abstract class and return inner ExceptionCause of your exceptions.

Implementing an extractor and providing it through SentryOptions.addExceptionCauseExtractor will enable the framework to extract the inner exceptions and add them as SentryException to SentryEvent.exceptions.

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

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

class ExceptionWithInnerExtractor extends ExceptionCauseExtractor<ExceptionWithInner>  {
  @override
  ExceptionCause? cause(ExceptionWithInner error) {
    return ExceptionCause(error.innerException, error.innerStackTrace);
  }
}

options.addExceptionCauseExtractor(ExceptionWithInnerExtractor());

Constructors

ExceptionCauseExtractor()

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

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

Operators

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