I have a simple test.coffee that compiles in test.js
Testing.
process.on 'uncaughtException', (er) ->
console.log 'Unhandled exception'
console.log 'Unhandled exception'
console.log 'Unhandled exception'
console.log 'Unhandled exception'
console.log 'Unhandled exception'
console.log 'Unhandled exception'
console.log 'Unhandled exception'
console.log 'Unhandled exception'
return
throw new Error("aAH")
And the produced test.js
(function() {
process.on('uncaughtException', function(er) {
console.log('Unhandled exception');
console.log('Unhandled exception');
console.log('Unhandled exception');
console.log('Unhandled exception');
console.log('Unhandled exception');
console.log('Unhandled exception');
console.log('Unhandled exception');
console.log('Unhandled exception');
});
throw new Error("aAH");
}).call(this);
From the command line or from vim via (! Node% and! Coffee%), etc. the outputs are surprisingly different.
node test.js behaves correctly and outputs to the console several excluded exception lines and exits. A call through "coffee test.coffee" returns to the default behavior for printing a stack trace and exiting. This example is obviously not my complete application, but, making a larger application, I could not get an unhandled exception to work when running my ExpressJS application through coffee boot.cofee, what am I doing wrong? This is the latest version of Node 0.4.8 and the latest version of Cofee 1.1.1 on Mac OS X 10.6.x
user53791