A music player that connects to your cloud/distributed storage.
at main 597 B view raw
1module Http.Ext exposing (errorToString) 2 3import Http exposing (Error(..)) 4 5 6 7-- 🛠 8 9 10errorToString : Http.Error -> String 11errorToString err = 12 -- Thanks to: https://github.com/hercules-ci/elm-hercules-extras/blob/1.0.0/src/Http/Extras.elm 13 case err of 14 Timeout -> 15 "Timeout exceeded" 16 17 NetworkError -> 18 "Network error" 19 20 BadStatus code -> 21 "Something went wrong, got status code: " ++ String.fromInt code 22 23 BadBody text -> 24 "Unexpected response: " ++ text 25 26 BadUrl url -> 27 "Malformed url: " ++ url