Created
November 7, 2018 15:03
-
-
Save jcmrva/1eff4c1d89185e86b97074bdb77d9d16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Http exposing (..) | |
toErrString : Http.Error -> String | |
toErrString err = | |
case err of | |
BadUrl s -> | |
"Bad URL: " ++ s | |
Timeout -> | |
"Timeout" | |
NetworkError -> | |
"Network Error" | |
BadStatus resp -> | |
"Status Error: " | |
++ String.fromInt resp.status.code | |
++ " " | |
++ resp.status.message | |
BadPayload s _ -> | |
"Payload Error: " | |
++ s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment