Hello.
I'm trying catch exception from cheshire.core/decode (or parse-string). But it didn't work
user=> (require ['cheshire.core :as 'json])
user=> (try (json/decode "[{\"id\":ty\":1}]") (catch Throwable _ (println "I catched exception")))
JsonParseException Unrecognized token 'ty': was expecting
at [Source: java.io.StringReader@1fd2f14; line: 1, column: 10] com.fasterxml.jackson.core.JsonParser._constructError (JsonParser.java:1369)
com.fasterxml.jackson.core.JsonParser._constructError is helper method for constucting JsonParseException object
called like:
throw _constructError("Numeric value ("+getText()+") out of range of Java byte")
--
Alexey Aleksandrov