How to use the @bugsnag/node function in @bugsnag/node

To help you get started, we’ve selected a few @bugsnag/node examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat.Electron / src / errorHandling.js View on Github external
export const setupErrorHandling = (appType) => {
	if (remote) {
		// eslint-disable-next-line no-proto
		setTimeout(() => {}).__proto__.unref = () => {};
	}

	const handleError = (error) => {
		logger.error(error && (error.stack || error));
		!remote && app.quit(1);
	};

	if (process.env.BUGSNAG_API_KEY) {
		bugsnagClient = bugsnag({
			apiKey: process.env.BUGSNAG_API_KEY,
			appVersion: app.getVersion(),
			appType,
			collectUserIp: false,
			onUncaughtException: handleError,
			onUnhandledRejection: handleError,
			releaseStage: process.env.NODE_ENV,
		});

		return;
	}

	process.on('uncaughtException', handleError);
	process.on('unhandledRejection', handleError);
};

@bugsnag/node

Bugsnag error reporter for Node.js

MIT
Latest version published 20 days ago

Package Health Score

89 / 100
Full package analysis

Similar packages