Added better server log errors
This commit is contained in:
parent
9f63552b81
commit
a118b91b79
4 changed files with 26 additions and 0 deletions
21
imports/startup/server/catchExceptions.js
Normal file
21
imports/startup/server/catchExceptions.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* eslint-disable import/no-absolute-path */
|
||||
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import ravenLogger from '/imports/startup/server/ravenLogger';
|
||||
|
||||
Meteor.startup(() => {
|
||||
const bound = Meteor.bindEnvironment((callback) => { callback(); });
|
||||
process.on('uncaughtException', (err) => {
|
||||
bound(() => {
|
||||
// console.error('Server crashed!', err);
|
||||
console.error(err);
|
||||
// console.error(err.stack);
|
||||
|
||||
// https://github.com/flowkey/meteor-raven
|
||||
ravenLogger.log(err);
|
||||
|
||||
// https://github.com/nodejs/node-v0.x-archive/blob/master/doc/api/process.markdown#exit-codes
|
||||
process.exit(7);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue