ExceptionTypeIdentifier class abstract

An abstract class for identifying the type of Dart errors and exceptions.

It's used in scenarios where error types need to be determined in obfuscated builds as runtimeType is not reliable in such cases.

Implement this class to create custom error type identifiers for errors or exceptions. that we do not support out of the box.

Example:

class MyExceptionTypeIdentifier implements ExceptionTypeIdentifier {
  @override
  String? identifyType(dynamic throwable) {
    if (throwable is MyCustomError) return 'MyCustomError';
    return null;
  }
}
Implementers
Available extensions

Constructors

ExceptionTypeIdentifier()

Properties

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

Methods

identifyType(dynamic throwable) String?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
withCache() ExceptionTypeIdentifier

Available on ExceptionTypeIdentifier, provided by the CacheableExceptionIdentifier extension

Operators

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