I'm sure this Mikeal guy is a genius and everything, but is it really necessary for him to interrupt and contradict the other guy (was that Isaac?) every 3 seconds?<p>Anyway this Domains idea, is it something like:<p><pre><code> var domain = require('domain');
var http = require('http');
var fs = require('fs');
domain.handleError('fsdb', data, function(err) {
console.log('There was an error updating thing #' + data);
});
updateThing = function(id, data, callback) {
domain.run('fsdb', id, function() {
var options = { host: 'things.myserver.io', port: 80,
path: '/update?id='+id+'&v='+data.new};
http.get(options, function(res) {
fs.writeFile(data.fname, data.file, function() {
callback();
});
});
});
}
</code></pre>
So something in fs and http makes it call domain.handleError with the details if there is a problem with the request or file write?<p>Forgive me if I am completely misunderstanding or if this is a bad example.