From 09f4fc9b9d8f59fc86ab870032b7d49616a319b9 Mon Sep 17 00:00:00 2001 From: Hannu Lyytikainen Date: Thu, 28 Sep 2017 17:36:04 +0300 Subject: [PATCH] Improve comments for Sentry client setup --- server/log.js | 4 ++++ src/util/log.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/server/log.js b/server/log.js index a274bbff..899f09aa 100644 --- a/server/log.js +++ b/server/log.js @@ -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: { diff --git a/src/util/log.js b/src/util/log.js index 00492202..6830b48f 100644 --- a/src/util/log.js +++ b/src/util/log.js @@ -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(); } };