In Chrome 42, throwing an error explicitly produces no stack trace unless
you add .-stack like so:

(throw
              (.-stack (js/Error.
                         "invalid types: expected :cursor-id and
:transform or [:sub-path]"))

the problem with doing this is that you end up with a JS stack trace

I think you're saying that in Canary you can throw js/Error without
the .-stack and it will
show a CLJS stack trace? If so, that's heaven sent...


On Fri, May 8, 2015 at 6:07 AM, Mike Thompson <[email protected]>
wrote:

> Just in case you don't now this ...
>
> Right now, if you are debugging ClojureScript, you need to be using Chrome
> 44 (currently Canary).
>
> Why?  Probably many reasons, but one in particular ...
>
> If a thrown exception is caught and then rethrown, in Chrome 42 (Stable)
> the uncaught exception handler does not display a stacktrace. It just
> displays the exception text. (Asserts display okay, but most other
> exceptions do not).
>
> Whereas, Chrome 44 (Canary) displays both the exception text and the stack
> trace correctly.  And that's absolute gold when you are debugging.  The
> difference between the exception text and the complete stacktrace is chalk
> and cheese.
>
> If you are using core.async this is especially relevant because go-loops
> catch exceptions, cleanup and then re-throw them. And, as I said above, it
> is these rethrown exceptions which Chrome 42 doesn't seem to handle well.
>
> But even for code not using core.async it is useful: For example, Reagent
> catches exceptions and re-throws them, and this has proved a problem:
> https://github.com/reagent-project/reagent/issues/120
>
> If you are forced to use Chrome 42 then this might work also (untested):
>     (set! (.-onerror js/window)  #(.error js/console (.-stack %1)))
>
> Although, in prod, you might want more curation around exceptions.
>
> --
> Mike
>
>
>
>
>
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/clojurescript.
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to