From 2d788946ab67a70ec4e2940d6473f8ef9d94c44d Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 22 Mar 2022 12:27:47 -0400 Subject: [PATCH] edit again --- src/events/CommandHandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/CommandHandler.ts b/src/events/CommandHandler.ts index 52e3fe7..44c7c44 100644 --- a/src/events/CommandHandler.ts +++ b/src/events/CommandHandler.ts @@ -12,7 +12,6 @@ export default class CommandHandler extends Event { } public async run(message: Message) { - const transaction = Sentry.startTransaction({ name: 'command-handler' }); try { this.client.db.mongo.Stat.updateOne({ name: 'messages' }, { $inc: { value: 1 } }).exec(); if (message.author.bot) return; @@ -28,7 +27,9 @@ export default class CommandHandler extends Event { } this.client.util.signale.log(`User '${message.author.username}#${message.author.discriminator}' ran command '${resolved.cmd.name}' in '${message.channel.id}'.`); try { + const transaction = Sentry.startTransaction({ name: 'command-handler' }); await resolved.cmd.run(message, resolved.args); + transaction.finish(); } catch (err) { this.client.util.handleError(err, message, resolved.cmd); } finally { @@ -37,6 +38,5 @@ export default class CommandHandler extends Event { } catch (err) { this.client.util.handleError(err, message); } - transaction.finish(); } }