ExceptionConverterSuite class
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
-
ExceptionConverterSuite({List<
ExceptionConverterFactory> exceptionConverters = const [], CodenicLogger? logger}) -
An abstract class that converts an exception
E
to a Failure if exceptionE
occurs while running observe .
Properties
-
exceptionConverters
→ List<
ExceptionConverterFactory> -
The default ExceptionConverters used to convert Exceptions into
Failures.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → CodenicLogger
-
The default logger used by observe.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
convert(
{required Object error, StackTrace? stackTrace, List< ExceptionConverter< ? exceptionConverters, MessageLog? messageLog}) → FailureException, void> > -
Converts the given
error
into a Failure. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observe<
T> ({required FutureOr< Either< task(MessageLog? messageLog), List<Failure, T> >ExceptionConverter< ? exceptionConverters, MessageLog? messageLog}) → Future<Exception, T> >Either< Failure, T> > -
Converts any uncaught Exception thrown by the
task
into a Failure. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited