I have an issue where a new endpoint returned (ok)
with no content, and http-fx
seemed to swallow the error. I'm digging into the code, and cannot figure out where would be a good place to catch this. Even the on-error
handler was not reached.
Ah, ok. Let me take a look at that.
> a new endpoint returned `(ok)` with no content, and `http-fx` seemed to swallow the error
I'm assuming (ok)
means 200 OK. If so, what is that error you write about?
So apparently the response-format was expecting JSON, and 'nil' will not work. This makes sense, but it would be nice to see an error message somewhere saying the response format is not what was expected.
Ah, so there's an exception somewhere saying that nil doesn't work?
No, there's no exception at all. Just nothing. Neither success nor error handler are called.
It swallows the error, so it's not logged or anything.
I just tried the same and I got this in the :on-failure
handler:
{:response nil,
:last-method "GET",
:original-text "",
:last-error "",
:failure :parse,
:status-text
"Unexpected end of JSON input Format should have been JSON",
:status 200,
:uri "/x",
:debug-message "No Error",
:last-error-code 0}
So I can't really add anything without seeing your actual code.
Oh, wait. In your OP you mention on-error
. But day8.re-frame/http-fx
expects :on-failure
.