Created
September 22, 2016 06:13
-
-
Save ndamnjanovic/279c95e53182908e4274dec31db232ca 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
// app.js | |
(function() { | |
var sails; | |
try { | |
sails = require('sails'); | |
} catch (e) { | |
... | |
var airbrake = require('airbrake').createClient( | |
'105138', // Project ID | |
'fd04e13d806a90f96614ad8e529b2822' // Project key | |
); | |
process.on('unhandledRejection', function(e) { | |
airbrake.handleExceptions() | |
console.log('Uncaught Exception...'); | |
console.log(e.stack); | |
process.exit(99); | |
}); | |
process.on('rejectionHandled', airbrake.handleExceptions()); | |
process.on('SIGINT', airbrake.handleExceptions()); | |
process.on('uncaughtException', airbrake.handleExceptions()); | |
// Start server | |
sails.lift(rc('sails')); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment