This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-09
Channels
- # announcements (19)
- # babashka (26)
- # beginners (157)
- # calva (54)
- # cider (12)
- # clj-kondo (18)
- # cljdoc (3)
- # clojure (65)
- # clojure-australia (3)
- # clojure-europe (28)
- # clojure-germany (14)
- # clojure-greece (1)
- # clojure-italy (8)
- # clojure-nl (10)
- # clojure-uk (81)
- # clojuredesign-podcast (2)
- # clojurescript (20)
- # clr (1)
- # conjure (1)
- # cursive (1)
- # data-science (29)
- # datascript (2)
- # datomic (19)
- # depstar (4)
- # fulcro (24)
- # graalvm (6)
- # helix (26)
- # jobs (2)
- # jobs-discuss (2)
- # kaocha (12)
- # leiningen (1)
- # malli (17)
- # off-topic (18)
- # pathom (34)
- # polylith (23)
- # re-frame (10)
- # reagent (8)
- # releases (1)
- # remote-jobs (1)
- # reveal (5)
- # shadow-cljs (49)
- # spacemacs (1)
- # startup-in-a-month (6)
- # vim (4)
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.
> 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.
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}
Oh, wait. In your OP you mention on-error
. But day8.re-frame/http-fx
expects :on-failure
.
Ah, ok. Let me take a look at that.