News for hackers. Stuff that matters.
Re:Node.js v0.8.0 [stable] is out by IsaacSchlueter on Monday June 25, 2012 @02:46PM (#4158001)
> Is it sort of like a try/catch for error events?

Yes, but it's also sort of like a try/catch for thrown errors.

    d = domain.create()
    d.on('error', function(e) {
      console.error('an error: ', e)
    });
    d.run(function() {
      throw new Error("whoops")
    })
would console.log, rather than crashing the program.

When an EventEmitter is bound to a domain, their error events and any errors thrown while emitting an event on them will be handled by the domain object that they're bound to.

There are no comments on this comment yet.