Globally catch nodejs exceptions

2 views
Skip to first unread message

Chris Granger

unread,
Dec 3, 2012, 8:13:26 PM12/3/12
to node-...@googlegroups.com
With 0.3.5, uncaught nodejs exceptions now show a screen with a cloud on it and a stacktrace. Is there a way to intercept this behavior to replace it with my own? I don't want a bug in a plugin for example destroying the state of the application, such that people might lose work. I'd much rather handle this with some global catchall. I used to do that by adding an event handler for uncaughtException, but that doesn't prevent the clouds from taking over.

Cheers,
Chris.

Roger

unread,
Dec 3, 2012, 8:16:54 PM12/3/12
to node-...@googlegroups.com
Thanks for your comments. We didn't expect this to break the applications when we add this feature. And we'd like to fix it ASAP.
--
You may say I am a dreamer, but I am not the only one.

Roger

unread,
Dec 3, 2012, 8:19:59 PM12/3/12
to node-...@googlegroups.com
btw, could you please provide your code of adding an event handler for uncaughtException? We can add it to our test cases.

Cheng Zhao

unread,
Dec 3, 2012, 8:20:01 PM12/3/12
to node-...@googlegroups.com
I'll prevent nw from printing stacktrace when there are other
listeners of uncaughtException.

Cheng

On Tue, Dec 4, 2012 at 9:16 AM, Roger <wen...@gmail.com> wrote:

Chris Granger

unread,
Dec 3, 2012, 8:33:39 PM12/3/12
to node-...@googlegroups.com
Not doing anything fancy with it, the ClojureScript code looks like this:

(.on js/process "uncaughtException" #(error %))

The equivalent js would be something like

process.on("uncaughtException", function(err) { alert("error: " + err); });

Cheers,
Chris.

Roger WANG

unread,
Dec 5, 2012, 1:43:56 AM12/5/12
to node-...@googlegroups.com
Roger <wen...@gmail.com> writes:

> Thanks for your comments. We didn't expect this to break the applications
> when we add this feature. And we'd like to fix it ASAP.

The binaries containing this fix on 0.3.5 are here:

https://s3.amazonaws.com/node-webkit/v0.3.6-pre/node-webkit-v0.3.6-pre-osx-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.3.6-pre/node-webkit-v0.3.6-pre-win-ia32.zip
https://s3.amazonaws.com/node-webkit/v0.3.6-pre/node-webkit-v0.3.6-pre-linux-ia32.tar.gz
https://s3.amazonaws.com/node-webkit/v0.3.6-pre/node-webkit-v0.3.6-pre-linux-x64.tar.gz

--
Roger WANG Intel Open Source Technology Center
Reply all
Reply to author
Forward
0 new messages