I almost already do. It was just about adding er.stack what my previous
past, has Isaac said.
But here it is:
var
fs = require('fs'),
domain = require('domain'),
d = domain.create();
function readSomeFile(filename, cb) {
fs.readFile(filename, 'utf8', d.bind(function(er, data) {
return cb(er, data ? JSON.parse(data) : null);
}));
}
d.on('error', function(er) {
// There is no stack
// I expect to see readSomeFile, fs.readFile, [...] in this stack
console.log(er.stack);
});
readSomeFile('invalid filename', function(er, data){
if (er) {
throw er;
}
});
--
--
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.