Improve comments for Sentry client setup

This commit is contained in:
Hannu Lyytikainen 2017-09-28 17:36:04 +03:00
parent a75615707b
commit 09f4fc9b9d
2 changed files with 6 additions and 0 deletions

View file

@ -15,6 +15,10 @@ const SENTRY_DSN = process.env.SERVER_SENTRY_DSN;
*/
exports.setup = () => {
if (SENTRY_DSN) {
// Configure the Sentry client. As is, this catches unhandled
// exceptions from starting the server etc. but does not catch the
// ones thrown from Express.js middleware functions. For those
// an error handler has to be added to the Express app.
Raven.config(SENTRY_DSN, {
environment: ENV,
autoBreadcrumbs: {

View file

@ -15,6 +15,8 @@ import config from '../config';
*/
export const setup = () => {
if (config.sentryDsn !== undefined) {
// Configures the Sentry client. Adds a handler for
// any uncaught exception.
Raven.config(config.sentryDsn, { environment: config.env }).install();
}
};