Fork me on GitHub

what is the purpose of error-interceptor-chain? Can’t find docs on this


I have a question:

       {:id :RESP
         {:parameters {:query {(s/required-key :p) String}}
          :produces #{;;"text/plain"
          :response (fn [ctx] {:data (format "Hello %s!\n" (-> ctx :parameters :query :p))})}}})]
    :get "/hello-response"
    {:headers {;; I was expecting the "Accept" header
               ;; to make yada.body/render-error "application/json" being called
               ;; instead of "text/plain" ?
               "Accept" "application/json"}})
;; => {:status 400, :headers {“content-length” “73", “content-type” “text/plain;charset=utf-8"}, :body “\r\n\r\n{:status 400, :errors ([:query {:error {:p missing-required-key}}])}\n”} ;; yada.body/render-error “text/plain” is called I was expecting “application/json” to be called. What am I doing wrong?


The default error handler doesn't offer application/json. The reason is because too many errors were swallowed by cheshire rendering exceptions. You could put in your own error interceptor chain if you need json


sounds good 🙂 thanks for confirming

Andrea Imparato21:10:37

hello everyone! can anyone give me a comparison between yada and liberator?