blob: 2e57819ed88015fb589ecee4e55e4f55c9820336 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
module Shared.Util.Http exposing (error_to_string)
import Http
error_to_string : Http.Error -> String
error_to_string error =
case error of
(Http.BadUrl string) -> ("Invalid URL: \"" ++ string ++ "\"")
Http.Timeout -> "Timed out"
Http.NetworkError -> "Connection lost, network error."
(Http.BadStatus response) ->
(
"The HTTP request failed: "
++ (String.fromInt response)
++ "."
)
(Http.BadBody string) ->
(
"Server response not understood:\""
++ string
++ "\"."
)
|