I’m trying to catch all uncaught Exceptions if our app crashes for some reason and log that message.
Is there a way to trigger this
import { logger } from "../../api/loggers/logger";
import { Meteor } from "meteor/meteor";
logger.info('Server started');
if(Meteor.isServer) {
Meteor.startup(Meteor.bindEnvironment(() => {
process.on('uncaughtException', Meteor.bindEnvironment(function (err) {
console.log(err.message);
console.log(err.stack);
logger.critical("App exited", err);
process.exit(1)
}));
}));
}