diff options
Diffstat (limited to 'src/client/elm/SimpleHTTP.elm')
-rw-r--r-- | src/client/elm/SimpleHTTP.elm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/elm/SimpleHTTP.elm b/src/client/elm/SimpleHTTP.elm index 99a7056..3e01178 100644 --- a/src/client/elm/SimpleHTTP.elm +++ b/src/client/elm/SimpleHTTP.elm @@ -22,7 +22,13 @@ handleResponse : Response -> Task Error Value handleResponse response = if 200 <= response.status && response.status < 300 then Task.succeed response.value - else fail (BadResponse response.status response.statusText) + else fail (BadResponse response.status (responseString response.value)) + +responseString : Value -> String +responseString value = + case value of + Text str -> str + _ -> "" promoteError : RawError -> Error promoteError rawError = |