mirror of
https://github.com/penpot/penpot.git
synced 2025-01-10 08:50:57 -05:00
🐛 Set proper return value on validation error handler.
This commit is contained in:
parent
f0e1bc1d59
commit
01c89f6554
1 changed files with 3 additions and 11 deletions
|
@ -55,17 +55,9 @@
|
|||
|
||||
(defmethod handle-exception :validation
|
||||
[err req]
|
||||
(let [header (get-in req [:headers "accept"])
|
||||
edata (ex-data err)]
|
||||
(if (and (= :spec-validation (:code edata))
|
||||
(str/starts-with? header "text/html"))
|
||||
{:status 400
|
||||
:headers {"content-type" "text/html"}
|
||||
:body (str "<pre style='font-size:16px'>"
|
||||
(:explain edata)
|
||||
"</pre>\n")}
|
||||
{:status 400
|
||||
:body (dissoc edata ::s/problems)})))
|
||||
(let [edata (ex-data err)]
|
||||
{:status 400
|
||||
:body (dissoc edata ::s/problems)}))
|
||||
|
||||
(defmethod handle-exception :assertion
|
||||
[error request]
|
||||
|
|
Loading…
Reference in a new issue