Skip to content

Commit

Permalink
🐛 Add error message when the sentry key is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Androz2091 committed Sep 24, 2020
1 parent e91b2b9 commit 27a8213
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions atlanta.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ const Sentry = require("@sentry/node"),
util = require("util"),
fs = require("fs"),
readdir = util.promisify(fs.readdir),
mongoose = require("mongoose");
mongoose = require("mongoose"),
chalk = require("chalk");

const config = require("./config");
if(config.apiKeys.sentryDSN){
Sentry.init({ dsn: config.apiKeys.sentryDSN });
try {
Sentry.init({ dsn: config.apiKeys.sentryDSN });
} catch (e) {
console.log(e);
console.log(chalk.yellow("Looks like your Sentry DSN key is invalid. If you do not intend to use Sentry, please remove the key from the configuration file."));
}
}

// Load Atlanta class
Expand Down

0 comments on commit 27a8213

Please sign in to comment.