Skip to content

Instantly share code, notes, and snippets.

@phillipj
Created August 10, 2015 19:23
Show Gist options
  • Save phillipj/e0b68ee632272454e386 to your computer and use it in GitHub Desktop.
Save phillipj/e0b68ee632272454e386 to your computer and use it in GitHub Desktop.
Handling network errors
var net = require('net');
net.connect(1216, myListener).on('error', myErrHandler);
function myListener() {
console.log('myListener got called');
}
function myErrHandler(err) {
console.log('woopsie, got error!', err);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment