Skip to content

Instantly share code, notes, and snippets.

@ndamnjanovic
Created September 22, 2016 06:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndamnjanovic/279c95e53182908e4274dec31db232ca to your computer and use it in GitHub Desktop.
Save ndamnjanovic/279c95e53182908e4274dec31db232ca to your computer and use it in GitHub Desktop.
// 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