Treat HTTP response statuses less than 200 as errors

In particular, browsers seem to use status 0 for errors
This commit is contained in:
Ken Micklas 2018-03-06 19:22:26 -05:00
parent 6593c1ce80
commit 0c740120f6

View File

@ -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))