The practical problem is that you have to try..catch every level of callback if it's a handler to some event.
Node alto provides a global event on the process global called "uncaughtException" This will attempt to be a catchall for uncaught exceptions.
> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
2010/9/21 foulmawcur <alan....@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
>
--
C уважением, Александр Лозовюк
Alpha-Beta-Release Blog
http://abrdev.com
To exemplify your problem outside the CouchDB context, here's a sample:
try {
setTimeout(function() {
throw "ERROR";
}, 0);
catch(ex) {
print("I got it!");
}
You won't ever see "I got it!", because the try/catch block exits
before the inner function runs.
Cheers,
-Mihai
> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
>
--
Mihai Bazon,
http://mihai.bazon.net/blog
2010/9/21 Mihai Călin Bazon <mihai...@gmail.com>:
--
To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.