Abstract class that is extended by all propagation types.
It makes it simpler to handle errors by not having to distinguish all different types separately every single time.
For example, the following snippet:
void example() {
try {
// some code that can throw
} on Propagation {
// `NonePropagation` and `ErrPropagation` do not
// need separate `on` blocks here
rethrow;
} catch (e) {
print(e);
}
}
is equivalent to:
void example() {
try {
// some code that can throw
} on NonePropagation {
rethrow;
} on ErrPropagation<Object> {
rethrow;
} catch (e) {
print(e);
}
}
- Inheritance
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
The stack trace at the point where this error was first thrown.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited