Forcing Meteor App To Crash with uncaughtException

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)
        }));
    }));
}

I use Sentry for this kind of exception logging, it works pretty well, there is a free service option, and a useful dashboard to managing problems

@mikkelking Did you find a way to test it if your app suddenly crashes or does sentry monitor the app and then lets you know if it is down

Sentry catches any uncaught exceptions and reports them. Otherwise you wouldn’t know about them, other than a restart entry in the output logs (which are probably not stored). I think it might also stop the process from exiting, reducing the down time.