mirror of
https://github.com/penpot/penpot.git
synced 2025-05-11 03:06:36 +02:00
🐛 Fix incorrect erorr reporting.
This commit is contained in:
parent
8f37f74d29
commit
01edf49de0
4 changed files with 24 additions and 8 deletions
|
@ -29,19 +29,18 @@
|
|||
(defmethod handle-exception :validation
|
||||
[err req]
|
||||
(let [header (get-in req [:headers "accept"])
|
||||
edata (ex-data err)]
|
||||
error (ex-data err)]
|
||||
(cond
|
||||
(and (str/starts-with? header "text/html")
|
||||
(= :spec-validation (:code edata)))
|
||||
(= :spec-validation (:code error)))
|
||||
{:status 400
|
||||
:headers {"content-type" "text/html"}
|
||||
:body (str "<pre style='font-size:16px'>"
|
||||
(with-out-str
|
||||
(:data edata))
|
||||
(:hint-verbose error)
|
||||
"</pre>\n")}
|
||||
:else
|
||||
{:status 400
|
||||
:body edata})))
|
||||
:body error})))
|
||||
|
||||
(defmethod handle-exception :ratelimit
|
||||
[_ _]
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
(defstate semaphore
|
||||
:start (Semaphore. (:image-process-max-threads cfg/config 1)))
|
||||
|
||||
|
||||
;; --- Generic specs
|
||||
|
||||
(s/def :internal.http.upload/filename ::us/string)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue