This will be given all errors (including of type UserException).
- If it returns a UserException, it will be used instead of the original exception.
- Otherwise, just return null, so that the original exception will not be modified.
The use case for this is to have a global place to convert some exceptions into UserExceptions. For example, Firebase may throw some PlatformExceptions in response to a bad connection to the server. In this case, you may want to show the user a dialog explaining that the connection is bad, which you can do by converting it to a UserException. Note, this could also be done in the ReduxAction.wrapError, but then you'd have to add it to all actions that use Firebase.