I wrote a little module <https://github.com/mpareja/node-domainit> because 
it allows me to execute a function that I don't control and handle errors 
in a simple, uniform way. Do you all think that using a standard callback 
style here makes sense? Or is this completely asinine because of 
some intricacy of domains that I missed? 

I've included the README below for your reading pleasure.

Cheers,

Mario Pareja


domainit - wrap a function with the safety of a domain

Wrap a function with the warm comfort of a node domain using standard 
callbacks.

var assert = require('assert');var domainit = require('domainit');
function unsafe(cb) {
  process.nextTick(function () {
    throw new Error('Oops!');
  });}
var safe = domainit(unsafe);safe(function (err) {
  assert(err);
  assert(err.message === 'Oops!');});

-- 
-- 
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