Another option would be to convert the error messages to a custom error and handle that in your code.
In other words, express in a type the fact that you expect a specific set of errors.
For example, you could have:
type Error
= Unauthenticated
| ConnectionProblems
| ServerError String
You would then convert the Http.Error
to one of these errors an react in you code to them. (i.e. redirect for Unauthenticated
, suggest checking connection/retry for ConnectionProblems
and log to Rollbar the ServerError
.