mirror of
https://github.com/penpot/penpot.git
synced 2025-06-12 20:01:39 +02:00
✨ Add better exception handling on json content type handling
This commit is contained in:
parent
54bb89b2bb
commit
0527c55398
1 changed files with 6 additions and 3 deletions
|
@ -22,9 +22,10 @@
|
||||||
(:import
|
(:import
|
||||||
com.fasterxml.jackson.core.JsonParseException
|
com.fasterxml.jackson.core.JsonParseException
|
||||||
com.fasterxml.jackson.core.io.JsonEOFException
|
com.fasterxml.jackson.core.io.JsonEOFException
|
||||||
|
com.fasterxml.jackson.databind.exc.MismatchedInputException
|
||||||
io.undertow.server.RequestTooBigException
|
io.undertow.server.RequestTooBigException
|
||||||
java.io.OutputStream
|
java.io.InputStream
|
||||||
java.io.InputStream))
|
java.io.OutputStream))
|
||||||
|
|
||||||
(set! *warn-on-reflection* true)
|
(set! *warn-on-reflection* true)
|
||||||
|
|
||||||
|
@ -78,11 +79,13 @@
|
||||||
|
|
||||||
|
|
||||||
(or (instance? JsonEOFException cause)
|
(or (instance? JsonEOFException cause)
|
||||||
(instance? JsonParseException cause))
|
(instance? JsonParseException cause)
|
||||||
|
(instance? MismatchedInputException cause))
|
||||||
(raise (ex/error :type :validation
|
(raise (ex/error :type :validation
|
||||||
:code :malformed-json
|
:code :malformed-json
|
||||||
:hint (ex-message cause)
|
:hint (ex-message cause)
|
||||||
:cause cause))
|
:cause cause))
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(raise cause)))]
|
(raise cause)))]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue