Re: ClojureScript: catching all javascript exceptions

2012-11-01 Thread Frank Siebenlist
Thanks Steve - exactly what I needed - cool stuff. On Nov 1, 2012, at 3:06 AM, Steve Buikhuizen wrote: > No problem. On the client (cljs) you should: > • require [goog.debug.ErrorReporter :as reporter] > • (reporter/install "/er") > On the server (I'm using Noir which supplies defpa

Re: ClojureScript: catching all javascript exceptions

2012-11-01 Thread Hubert Iwaniuk
In past I used (goog.debug.ErrorReporter/install"logError") It worked great. HTH, Hubert. Steve Buikhuizen wrote: No problem. On the client (cljs) you should: 1. require [goog.debug.ErrorReporter :as reporter] 2. (reporter/install"/er") On the server (I'm using Noir which supplies defpage)

Re: ClojureScript: catching all javascript exceptions

2012-11-01 Thread Steve Buikhuizen
No problem. On the client (cljs) you should: 1. require [goog.debug.ErrorReporter :as reporter] 2. (reporter/install "/er") On the server (I'm using Noir which supplies defpage) (defpage [:post "/er"] {:keys [error line script trace]} (service/record-client-error error line script tr

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Frank Siebenlist
Hi Steve, That sounds very intriguing, but with my limited javascript&goog knowledge it's difficult to see how you would go about it. Could you please elaborate on what you did and how you get those js-errors reported back to a web server as some form of logging-service (?). Thanks, FrankS.

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Steve Buikhuizen
Take a look at http://closure-library.googlecode.com/svn-history/r9/trunk/closure/goog/docs/class_goog_debug_ErrorReporter.html Since all Google Closure is available to clojurescript (in web clients) you can use the static "install" method to log all errors in the client back to the server.

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Herwig Hochleitner
try in clojurescript is actually a macro that uses the builtin try* and adds type dispatch. So to catch everything, just use (try* ... (catch e ...)). This maps directly to javascript's try. This question seems to come up a lot: Maybe it should be documented where it's visible to people looking fo

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Frank Siebenlist
Very useful example - thanks. This should be explained in the official clojurescript doc pages in the exceptions section. -FS. On Oct 31, 2012, at 3:24 AM, Alexander Solovyov wrote: > On Wed, Oct 31, 2012 at 11:22 AM, AtKaaZ wrote: >> seems to be working here: https://himera.herokuapp.com/

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread Alexander Solovyov
On Wed, Oct 31, 2012 at 11:22 AM, AtKaaZ wrote: > seems to be working here: https://himera.herokuapp.com/index.html > > cljs.user> (try (+ 1 2) (catch js/Error e e)) > 3 > cljs.user> (try (throw (js/Error. "err1")) (catch js/Error e e)) > # This is not working: (try (throw "err1") (catch js/Erro

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread AtKaaZ
seems to be working here: https://himera.herokuapp.com/index.html cljs.user> (try (+ 1 2) (catch js/Error e e)) 3 cljs.user> (try (throw (js/Error. "err1")) (catch js/Error e e)) # On Wed, Oct 31, 2012 at 10:19 AM, AtKaaZ wrote: > > https://github.com/clojure/clojurescript/blob/master/src/clj

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread AtKaaZ
https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/reflect.cljs#L7 https://github.com/clojure/clojurescript/blob/master/src/cljs/clojure/browser/repl.cljs#L30 Looks implemented and it's same as in clojure ... What do you think? On Wed, Oct 31, 2012 at 9:31 AM, xiefei wrote: >

Re: ClojureScript: catching all javascript exceptions

2012-10-31 Thread xiefei
followed strategy #1 explained here to write (try ... (catch e ...)) and (try ... (catch _ ...)) , no luck. The compiler says "unsupported bind form". Maybe this construct just not implemented now. 在 2012年9月27日星期四UTC+8下午11时08分2

ClojureScript: catching all javascript exceptions

2012-09-28 Thread Dima B
Hi, I came to the point where I need to be able to catch all javascript exceptions, log them down and swallow. I've been trying to achieve this by (try ... (catch Exception e ...)) (try ... (catch nil e ...)) (try ... (catch js/object e ...)) and nothing seems to do the trick. Could you please