In the latest copy of core.async (taken from github master), I get this
error:
(go
(try
(go (throw (Exception.)))
(catch Exception ex
(println "catched"))))
xception in thread "async-dispatch-2" java.lang.Error: java.lang.Exception
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1151)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.Exception
at
user$eval2509$fn__2510$state_machine__2342__auto____2511$fn__2517$fn__2518$state_machine__2342__auto____2519.invoke(NO_SOURCE_FILE:1)
at
clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:763)
at
user$eval2509$fn__2510$state_machine__2342__auto____2511$fn__2517$fn__2518.invoke(NO_SOURCE_FILE:1)
at clojure.lang.AFn.run(AFn.java:24)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
... 2 more
#<ManyToManyChannel
clojure.core.async.impl.channels.ManyToManyChannel@723fff84>
This is exactly as expected. In your code snippet, the exception is
escaping the inner go. If you want to catch that exception, you need to put
the try/catch inside the go block.
Timothy
On Mon, Jul 15, 2013 at 10:20 PM, Alice <[email protected]> wrote:
> user=> (go
> (try
> (go (throw (Exception.)))
> (catch Exception ex
> (println "catched"))))
>
> IllegalArgumentException contains? not supported on type:
> clojure.lang.PersistentList clojure.lang.RT.contains (RT.java:724)
>
>
> Why am I getting this error?
>
> --
> --
> 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.
>
>
>
--
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)
--
--
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.