ErrFlow<T> class

A class that facilitates handling and logging of errors.

Constructors

ErrFlow(T defaultValue)
Creates an ErrFlow that facilitates handling and logging of errors. [...]

Properties

criticalErrorHandler ↔ void Function<S>(S, T)
The default error handler function for critical errors. [...]
read / write
defaultValue → T
A getter for the value that was set in the constructor and is used as the initial value for lastError in an object of the ErrNotifier class and its variants in each scope().
read-only
errorHandler ↔ void Function<S>(S, T)
The default error handler function for non-critical errors. [...]
read / write
hashCode → int
The hash code for this object. [...]
read-only, inherited
logger ↔ Future<void> Function(dynamic, StackTrace, {dynamic reason})
A logger function that is called when an error is notified. [...]
read / write
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addListener(ErrListener<T> listener) → void
Registers a listener, which is a function to be called when new error information is set by ErrNotifier.set(), ErrNotifier.log(), LoggingErrNotifier.set() or LoggingErrNotifier.log(). [...]
dispose() → void
Discards the resources used by the object. After this is called, the object is not in a usable state and should be discarded.
ignorableScope<S>(Future<S> process(IgnorableErrNotifier<T>)) → Future<S>
Executes the provided function process with an object of IgnorableErrNotifier passed to it. [...]
loggingScope<S>(Future<S> process(LoggingErrNotifier<T>)) → Future<S>
Executes the provided function process with an object of LoggingErrNotifier passed to it. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeListener(ErrListener<T> listener) → void
Removes a previously registered listener from the list of listeners. If the given listener is not registered, the call is ignored. [...]
scope<S>(Future<S> process(ErrNotifier<T>), {bool errorIf(S, T), bool criticalIf(S, T), void onError(S, T), void onCriticalError(S, T)}) → Future<S>
Executes the provided function process, and then calls either of the onError and onCriticalError callbacks if the condition specified by errorIf or criticalIf is met respectively. [...]
toString() → String
Returns a string representation of this object.
override
useDefaultLogger() → void
Sets the default logger to be used, which outputs information such as the message of an exception and the stack trace to the console.

Operators

operator ==(Object other) → bool
The equality operator. [...]
inherited