ExceptionConverter<E extends Exception, T> class abstract base

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 exception E 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 the exception is the same as E. Otherwise, false is returned.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe({required FutureOr<Either<Failure, T>> task(MessageLog? messageLog), CodenicLogger? logger, MessageLog? messageLog}) Future<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