Closed i-am-the-slime closed 1 year ago
Wouldn't it be better to throw the error in Aff
? Than you can attempt
it if needed. I think usually you expect a proper message or it should be encoded in the http status, like e.g. 204. Everything else is imho an error on the backend side.
Maybe
would also be very annoying most of the times and returning {}
in the empty case just feels wrong imho.
Yeah, I am doing attempt
but of course only after I get a production crash and find out that I should've used attempt
because this specific error code does not have a body. I guess another alternative is to just read the body as a string
and parse it on the PureScript side.
If you attempt to do run
json
on a response without a body you get an ugly messageless error right now. I thinkjson
could either return aMaybe
or we could default to{}
.