mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
✨ Properly report malformed json error
This commit is contained in:
parent
38ed3b076a
commit
59ba87d9cd
1 changed files with 6 additions and 2 deletions
|
@ -19,6 +19,7 @@
|
|||
[yetti.request :as yrq]
|
||||
[yetti.response :as yrs])
|
||||
(:import
|
||||
com.fasterxml.jackson.core.JsonParseException
|
||||
com.fasterxml.jackson.core.io.JsonEOFException
|
||||
io.undertow.server.RequestTooBigException
|
||||
java.io.OutputStream))
|
||||
|
@ -60,10 +61,13 @@
|
|||
:code :request-body-too-large
|
||||
:hint (ex-message cause)))
|
||||
|
||||
(instance? JsonEOFException cause)
|
||||
|
||||
(or (instance? JsonEOFException cause)
|
||||
(instance? JsonParseException cause))
|
||||
(raise (ex/error :type :validation
|
||||
:code :malformed-json
|
||||
:hint (ex-message cause)))
|
||||
:hint (ex-message cause)
|
||||
:cause cause))
|
||||
:else
|
||||
(raise cause)))]
|
||||
|
||||
|
|
Loading…
Reference in a new issue