mirror of
https://github.com/ilyakooo0/servant-reflex.git
synced 2024-10-26 10:20:01 +03:00
Treat HTTP response statuses less than 200 as errors
In particular, browsers seem to use status 0 for errors
This commit is contained in:
parent
6593c1ce80
commit
0c740120f6
@ -380,7 +380,8 @@ evalResponse
|
||||
-> (tag, XhrResponse)
|
||||
-> ReqResult tag a
|
||||
evalResponse decode (tag, xhr) =
|
||||
let okStatus = _xhrResponse_status xhr < 400
|
||||
let status = _xhrResponse_status xhr
|
||||
okStatus = status >= 200 && status < 400
|
||||
errMsg = fromMaybe
|
||||
("Empty response with error code " <>
|
||||
T.pack (show $ _xhrResponse_status xhr))
|
||||
|
Loading…
Reference in New Issue
Block a user