This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-30
Channels
- # announcements (5)
- # babashka (9)
- # beginners (48)
- # calva (300)
- # clj-kondo (9)
- # clojure (44)
- # clojure-austin (2)
- # clojure-europe (14)
- # clojure-uk (4)
- # clojurescript (1)
- # conjure (2)
- # datascript (3)
- # datomic (8)
- # exercism (5)
- # fulcro (1)
- # luminus (4)
- # music (1)
- # off-topic (12)
- # pathom (2)
- # rdf (18)
- # react (8)
- # sci (78)
- # shadow-cljs (12)
- # spacemacs (4)
- # tools-build (5)
- # tools-deps (26)
- # vim (4)
- # xtdb (8)
Hello, I don't exactly understand why my my :default-result-action!
receives an empty http body after I parse it with :response-middleware
and associate it in the response. Here's my middleware code:
(try
(if (= :network-error error)
response
(let [new-body (if (str/blank? body)
{}
(transit/read reader body))
response (assoc response :body new-body)]
response))
(catch :default e
(log/warn "Transit decode failed! See ")
(assoc response :status-code 417 :status-text "body was either not transit or you have not installed the correct transit read/write handlers.")))
(the reponse as returned by this code is valid, but the :default-result-action!
isn't)