···111111 "Got a faulty response from this source. Use the developer console to get more info."
112112113113 BadBody response ->
114114- Services.parseErrorResponse service response
114114+ response
115115+ |> Services.parseErrorResponse service
116116+ |> Maybe.withDefault (translateHttpError service <| BadStatus 0)
···11-module Common exposing (Switch(..), backToIndex, boolFromString, boolToString, queryString, urlOrigin)
11+module Common exposing (Switch(..), backToIndex, boolFromString, boolToString, queryString, translateHttpResponse, urlOrigin)
2233+import Http
34import Tuple.Ext as Tuple
45import Url exposing (Protocol(..), Url)
56import Url.Builder as Url
···4950queryString : List ( String, String ) -> String
5051queryString =
5152 List.map (Tuple.uncurry Url.string) >> Url.toQuery
5353+5454+5555+translateHttpResponse : Http.Response String -> Result Http.Error String
5656+translateHttpResponse response =
5757+ case response of
5858+ Http.BadUrl_ u ->
5959+ Err (Http.BadUrl u)
6060+6161+ Http.Timeout_ ->
6262+ Err Http.Timeout
6363+6464+ Http.NetworkError_ ->
6565+ Err Http.NetworkError
6666+6767+ Http.BadStatus_ m body ->
6868+ Err (Http.BadBody body)
6969+7070+ Http.GoodStatus_ m body ->
7171+ Ok body
527253735474urlOrigin : Url -> String
+1-1
src/Library/Sources/Services.elm
···101101 WebDav.makeTree
102102103103104104-parseErrorResponse : Service -> String -> String
104104+parseErrorResponse : Service -> String -> Maybe String
105105parseErrorResponse service =
106106 case service of
107107 AmazonS3 ->