mirror of
https://github.com/penpot/penpot.git
synced 2025-07-29 12:47:15 +02:00
✨ Improve error report of invalid image
This commit is contained in:
parent
2a0031d23c
commit
81facd58c9
2 changed files with 6 additions and 3 deletions
|
@ -74,7 +74,7 @@
|
|||
::yrs/headers headers}))
|
||||
|
||||
(defmethod handle-exception :validation
|
||||
[err _]
|
||||
[err request]
|
||||
(let [{:keys [code] :as data} (ex-data err)]
|
||||
(cond
|
||||
(= code :spec-validation)
|
||||
|
@ -95,6 +95,11 @@
|
|||
(= code :request-body-too-large)
|
||||
{::yrs/status 413 ::yrs/body data}
|
||||
|
||||
(= code :invalid-image)
|
||||
(binding [l/*context* (request->context request)]
|
||||
(l/error :hint "unexpected error on processing image" :cause err)
|
||||
{::yrs/status 400 ::yrs/body data})
|
||||
|
||||
:else
|
||||
{::yrs/status 400 ::yrs/body data})))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue