Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2022-02-01 16:14:52 +01:00
commit 5f81c7bc2d
13 changed files with 178 additions and 72 deletions

View file

@ -61,8 +61,15 @@
(defmethod handle-exception :validation
[err _]
(let [edata (ex-data err)]
{:status 400 :body (dissoc edata ::s/problems ::s/value)}))
(let [data (ex-data err)
explain (binding [s/*explain-out* expound/printer]
(with-out-str
(s/explain-out (update data ::s/problems #(take 10 %)))))]
{:status 400
:body (-> data
(dissoc ::s/problems)
(dissoc ::s/value)
(assoc :explain explain))}))
(defmethod handle-exception :assertion
[error request]