[ClojureScript] Re: Exception while inside core.async go block

2014-08-24 Thread Yehonathan Sharvit
I have tested your code and I saw that an exception was thrown in the the browser console. On Sunday, 16 February 2014 04:27:06 UTC+2, AN wrote: I recently encountered an issue with exceptions being thrown inside a core.async go block. The following code does not result in any sort of an

[ClojureScript] How to catch exceptions that occur inside a go block

2014-08-24 Thread Yehonathan Sharvit
I would like to catch exceptions that occur inside a go block. I need to catch the exceptions from outside the go block. I tried to write this piece of code but it didn't work. The exception was not caught. (try (go (throw (js/Error.My Exception in go block))) (catch js/Object e

[ClojureScript] Re: How to catch exceptions that occur inside a go block

2014-08-24 Thread Thomas Heller
Since a go block is async you cannot try/catch from outside. You need to either try/catch inside the block and return the exception as the result of the go block or use an extra channel to handle errors. (def errors (async/chan)) ;; exception handler (go (loop [] (when-let [ex (!

Re: [ClojureScript] How to insert a comment in the generated javascript file?

2014-08-24 Thread Yehonathan Sharvit
It works now. Thanks. But what is this “resources” folder? Is it hard-coded in the cljs compiler? Where is it documented? On Wed, Aug 6, 2014 at 2:35 PM, Daniel Kersten dkers...@gmail.com wrote: I believe it needs to be on the classpath. For example, I put my js files in resources/assets

Re: [ClojureScript] How to insert a comment in the generated javascript file?

2014-08-24 Thread Daniel Kersten
If you use `lein new` it should have been created for you. Its a directory that gets added to the classpath and is typically used for non-code resources and by default is resources. You can change it (or add other directories to it) by setting :resource-paths in your project.clj:

[ClojureScript] Re: How to catch exceptions that occur inside a go block

2014-08-24 Thread Andrew Chambers
On Sunday, August 24, 2014 7:30:23 PM UTC+12, Yehonathan Sharvit wrote: I would like to catch exceptions that occur inside a go block. I need to catch the exceptions from outside the go block. I tried to write this piece of code but it didn't work. The exception was not caught. (try