Fork me on GitHub
#ring-swagger
<
2017-06-11
>
ikitommi18:06:16

@plins fixed in the next alpha, with this regression test:

(facts "body in error handling, #306 & #313"
  (let [app (api
              {:exceptions
               {:handlers
                {:compojure.api.exception/default
                 (fn [_ _ request]
                   (internal-server-error (:body-params request)))}}}
              (POST "/error" []
                (throw (RuntimeException. "error"))))
        [status body] (post* app "/error" (json {:kikka 6}))]
    status => 500
    body => {:kikka 6}))

ikitommi18:06:01

needed to split the exception handling in two: all but request-parsing (after Muuntaja) and request-parsing (before Muuntaja), so there is now an extra middleware in the request pipeline. Adds some nanosecs to the request processing, but I optimized the parameter merging on the same time and it’s now actually 12% faster.