In order to not crash a server, we catch any uncaught exception in main.js. However, the request does not terminate then. Is there a way to terminate the active request?
//keep server from crashing by catching all exceptions not caught before
process.on('uncaughtException', function(err) {
console.log(err);
//kill request that caused the error
});
//launch server
https.createServer(options, app).listen(appSettings.ports.https, function(){
console.log('Express https server listening on port %d in %s mode',appSettings.ports.https, app.settings.env);
});