wrapError method
- dynamic error
If any error is thrown by reduce
or before
, you have the chance
to further process it by using wrapError
. Usually this is used to wrap
the error inside of another that better describes the failed action.
For example, if some action converts a String into a number, then instead of
throwing a FormatException you could do:
wrapError(error) => UserException("Please enter a valid number.", error: error)
Implementation
Object wrapError(error) => error;