Is json/decode returning a lazy seq? If so, you're constructing it inside
the try and then realizing it outside the try, and the exception may be
coming from the realization step.


On Wed, Sep 11, 2013 at 4:56 AM, Алексей Александров <
[email protected]> wrote:

> 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
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to