Created
July 9, 2012 15:11
-
-
Save kanonji/3077081 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events.js:48 | |
throw arguments[1]; // Unhandled 'error' event | |
^ | |
Error: listen EACCES | |
at errnoException (net.js:670:11) | |
at Array.0 (net.js:756:28) | |
at EventEmitter._tickCallback (node.js:190:38) |
Jxck
commented
Jul 9, 2012
Domain を使った場合。
var net = require('net');
var domain = require('domain');
var d = domain.create();
var d2 = domain.create();
var server;
d.run(function() {
server = net.createServer(function(c) {
console.log('server connected');
})
});
d2.run(function() {
server.listen(80, function(error) {
if(error) console.error("error :" + error);
})
});
d.on('error', function(err) {
console.error('domain1', err); // こっちで補足できます。
});
d2.on('error', function(err) {
console.error('domain2', err);
});
process.on('uncaughtException', function(err) {
console.error('process', err);
});
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment