servant-client-ghcjs: Fixed not throwing FailureResponse
This commit is contained in:
parent
74bde0a73d
commit
911be50df2
1 changed files with 7 additions and 1 deletions
|
@ -89,7 +89,13 @@ performRequest req = do
|
|||
xhr <- liftIO initXhr
|
||||
burl <- asks baseUrl
|
||||
liftIO $ performXhr xhr burl req
|
||||
toResponse xhr
|
||||
resp <- toResponse xhr
|
||||
|
||||
let status = statusCode (responseStatusCode resp)
|
||||
unless (status >= 200 && status < 300) $
|
||||
throwError $ FailureResponse resp
|
||||
|
||||
pure resp
|
||||
|
||||
-- * initialization
|
||||
|
||||
|
|
Loading…
Reference in a new issue