PredicatesErrorFilter class
Takes a list of predicate functions and returns the first non null ErrorReaction or ErrorReaction.defaultHandler if no predicate matches. The predicates are called in the order of the list. which means if you want to match against a type hierarchy you have to put the more specific type first. You can define your own predicates or use the errorFilter function like this
final filter = PredicatesErrorFilter([
errorFilter<ArgumentError>(error, ErrorReaction.throwException),
errorFilter<RangeError>(error, ErrorReaction.throwException),
errorFilter<Exception>(error, ErrorReaction.globalIfNoLocalHandler),),
]);
In contrast to the [TableErrorFilter] this filter can match against the
type hierarchy using the [errorFilter] function.
- Implemented types
Constructors
-
PredicatesErrorFilter(List<
ErrorFilterPredicate> _filters) -
const
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
-
filter(
Object error, StackTrace stackTrace) → ErrorReaction -
override
-
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