Skip to content

Instantly share code, notes, and snippets.

@jcmrva
Created November 7, 2018 15:03
Show Gist options
  • Save jcmrva/1eff4c1d89185e86b97074bdb77d9d16 to your computer and use it in GitHub Desktop.
Save jcmrva/1eff4c1d89185e86b97074bdb77d9d16 to your computer and use it in GitHub Desktop.
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