require('dotenv').config();
require('console-stamp')(console);

// Sentry
if (process.env.SENTRY_DSN) {
    const raven = require('raven');
    raven.config(process.env.SENTRY_DSN).install();
}

require('dotenv').config();
require('console-stamp')(console);

// Sentry error reporting
const raven = require('raven');
raven.config(process.env.SENTRY_DSN).install();

Fix an issue when a Sentry DSN isn't set
Fix an issue when a Sentry DSN isn't set

We can still set it up without a DSN, it'll just disable error reporting. Without running config(), calling raven.captureException() will throw its own exception.