An abstract class that converts an exception E
to a Failure if exception
E
occurs while running observe .
If no error occurs, then value T
is returned.
While a single ExceptionConverter may not be very useful on its own, you can use a group of exception converters together in an ExceptionConverterSuite to run a task and automatically convert any exceptions that are thrown into the appropriate Failure object.
Constructors
- ExceptionConverter()
-
An abstract class that converts an exception
E
to a Failure if exceptionE
occurs while running observe .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
-
convert(
{required E exception, StackTrace? stackTrace, CodenicLogger? logger, MessageLog? messageLog}) → Failure -
Converts the Exception
E
to a Failure. -
exceptionEquals(
Exception exception) → bool -
Returns
true
if theexception
is the same asE
. Otherwise,false
is returned. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observe(
{required FutureOr< Either< task(MessageLog? messageLog), CodenicLogger? logger, MessageLog? messageLog}) → Future<Failure, T> >Either< Failure, T> > -
Executes and observes the given
task
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited