I read it in the node documentation, as did the OP, where the exact quote 
is reproduced.  It specifically is on the docs page for domains: 
http://nodejs.org/api/domain.html#domain_warning_don_t_ignore_errors.

It's the most prominent instruction we have regarding how to handle thrown 
errors, and it says to kill the process completely (in the context of that 
page, use domains and cluster to kill the worker process and spin up a new 
one).  That's great, and is the right approach in many situations, but it's 
not universal.  It's perhaps not much publicized when you might want to use 
a simple try/catch to continue on without worry because, according to 
nodejitsu (http://docs.nodejitsu.com/articles/errors/what-is-try-catch) the 
only place in node core we really use it is the example I gave, 
JSON.parse().  But inherent in that example are the reasons why you 
generally want to take more care and why, in some simpler situations, you 
may not need to.

As I said, my main point is that the warning, as stated, doesn't really 
provided a basis for learning why and, subsequently, intelligently using 
and handling errors.

On Friday, January 3, 2014 1:29:44 PM UTC-5, Sam Roberts wrote:
>
> On Fri, Jan 3, 2014 at 9:44 AM, Jason Shinn <[email protected]<javascript:>> 
> wrote: 
> > Thank you.  My main point is that I've been wandering extensively around 
> the 
> > node-verse for the past 6 weeks and this is the first time I've ever 
> seen a 
> > definitive statement that try/catch is actually safe in that (or a 
> similarly 
> > simple) context. 
>
> Where did you hear it suggested that try/catch isn't safe? 
>
> Its perfectly acceptable and recommended to handle errors in node when 
> you know enough about the context to be able to. Node even includes a 
> feature to do so, domains, see the api docs on nodejs.org. 
>
> Blithely ignoring errors is a bad idea in node, or any other dynamic 
> language where fundamental problems like invalid syntax, non-existent 
> modules during require, attempts to call undefined methods or 
> functions, servers failing to listen because a port is used, etc., are 
> all errors that can be caught. 
>
> Cheers, 
> Sam 
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to