WrapError<St> class abstract

WrapError is deprecated in favor of GlobalWrapError.

The reason for this deprecation is that the GlobalWrapError works in the same way as the action's ReduxAction.wrapError, while WrapError does not.

The difference is that when WrapError returns null, the original error is not modified, while with GlobalWrapError returning null will disable the error (just like ReduxAction.wrapError does).

In other words, where your old WrapError returned null, your new GlobalWrapError should return the original error:

// WrapError (deprecated):
Object? wrap(error, stackTrace, action) {
   if (error is MyException) return null; // Keep the error unaltered.
   else return processError(error); // May change the error, but not disable it.
}

// GlobalWrapError:
Object? wrap(error, stackTrace, action) {
   if (error is MyException) return error; // Keep the error unaltered.
   else return processError(error); // May change or disable the error.
}
Annotations
  • @Deprecated('Use GlobalWrapError instead. ' 'However, where WrapError returned `null`, GlobalWrapError should return the original error. ' 'Check the documentation for more details.')

Constructors

WrapError()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
wrap(Object error, StackTrace stackTrace, ReduxAction<St> action) Object?
This method is deprecated in favor of GlobalWrapError.wrap.

Operators

operator ==(Object other) bool
The equality operator.
inherited