Created
January 27, 2012 01:12
-
-
Save isaacs/1686286 to your computer and use it in GitHub Desktop.
This file contains 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
// node fail.js | head -n3 | |
function write() | |
{ | |
try { | |
process.stdout.write('Hello, world\n'); | |
} catch (ex) { | |
throw new Error('this should not happen'); | |
} | |
process.nextTick(function () { write(); }); | |
} | |
process.stdout.on('error', function (er) { | |
console.error(er); | |
process.exit(42); | |
}); | |
write(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment