Getting stack traces in ClojureScript

In my ClojureScript programs running on FireFox 5.0 on Ubuntu 10.04.1 LTS, I get one cryptic line when an exception is thrown.

'Error: there is no ISeqable.-seq protocol method for an object of type: [object Object]' when calling the method: [nsIDOMEventListener :: handleEvent]

The "-seq" bit seems odd to me, and I searched for the generated javascript files for it and didn't find it.

I hope that I don’t miss something completely obvious, but how do I get the stack trace from the generated exception? How do you debug your scripts?

+5
source share
2 answers

, Javascript Clojurescript, Clojure. (my-function (js->clj my-thing)) : , , (.strobj),

+1

, . (?) ( 10 , iirc) , "", - :

(try ...throws...
    (catch js/Error e
        (.log js/console (.-stack e))))

, , . javascript ( ) . .

(try ...throws...
    (catch js/Error e
        (.log js/console e)))

, chrome , javascript . , , .

javascript, , , clojurescript. , , , , , . ​​

+1

All Articles