Skip to content

Commit

Permalink
sentry: move level setter to main instead of setting in for each error
Browse files Browse the repository at this point in the history
  • Loading branch information
rasmusgerdin committed Aug 19, 2020
1 parent 9253b36 commit 2ebe826
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion src/events/rtbyteCommandError.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = class extends Event {
async run(message, command, params, error) {
Sentry.withScope(scope => {
scope.setTag('error-type', 'command');
scope.setLevel(this.client.options.production ? 'error' : 'debug');
scope.setContext('Message', message);

Sentry.captureException(error);
Expand Down
1 change: 0 additions & 1 deletion src/events/rtbyteEventError.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = class extends Event {
async run(event, args, error) {
Sentry.withScope(scope => {
scope.setTag('error-type', 'event');
scope.setLevel(this.client.options.production ? 'error' : 'debug');

Sentry.captureException(error);
});
Expand Down
1 change: 0 additions & 1 deletion src/events/rtbyteFinalizerError.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = class extends Event {
async run(message, command, response, timer, finalizer, error) {
Sentry.withScope(scope => {
scope.setTag('error-type', 'finalizer');
scope.setLevel(this.client.options.production ? 'error' : 'debug');
scope.setContext('Message', message);

Sentry.captureException(error);
Expand Down
1 change: 0 additions & 1 deletion src/events/rtbyteMonitorError.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = class extends Event {
async run(message, monitor, error) {
Sentry.withScope(scope => {
scope.setTag('error-type', 'monitor');
scope.setLevel(this.client.options.production ? 'error' : 'debug');
scope.setContext('Message', message);

Sentry.captureException(error);
Expand Down
1 change: 0 additions & 1 deletion src/events/rtbyteTaskError.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = class extends Event {
async run(scheduledTask, task, error) {
Sentry.withScope(scope => {
scope.setTag('error-type', 'task');
scope.setLevel(this.client.options.production ? 'error' : 'debug');
scope.setContext(scheduledTask);

Sentry.captureException(error);
Expand Down
1 change: 1 addition & 0 deletions src/lib/RTByteSentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Sentry.configureScope(scope => {
'klasa-version': klasaVersion,
'd.js-version': discordVersion
});
scope.setLevel(this.client.options.production ? 'error' : 'debug');
});

if (sentryIngestURL) console.log('Sentry.io error reporting is active.');

0 comments on commit 2ebe826

Please sign in to comment.