diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-03-14 20:44:16 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-03-14 20:44:16 -0400 |
commit | 6c9710cb76347b79a2463ec0ca5bde59177b531f (patch) | |
tree | f6b00aa2af9b84ca2e99c3699145fe5475a27cf9 /src/listeners/track-manual-punishments | |
parent | 59a4eb09916ad7c9e6cd8ea8b4d3a72189c284ce (diff) | |
download | tanzanite-6c9710cb76347b79a2463ec0ca5bde59177b531f.tar.gz tanzanite-6c9710cb76347b79a2463ec0ca5bde59177b531f.tar.bz2 tanzanite-6c9710cb76347b79a2463ec0ca5bde59177b531f.zip |
feat(logging): over complicated repl
Diffstat (limited to 'src/listeners/track-manual-punishments')
4 files changed, 12 insertions, 8 deletions
diff --git a/src/listeners/track-manual-punishments/modlogSyncBan.ts b/src/listeners/track-manual-punishments/modlogSyncBan.ts index 7d77a76..b1bdcee 100644 --- a/src/listeners/track-manual-punishments/modlogSyncBan.ts +++ b/src/listeners/track-manual-punishments/modlogSyncBan.ts @@ -34,8 +34,9 @@ export default class ModlogSyncBanListener extends BushListener { if (!first.executor || first.executor?.bot) return; if (Math.abs(first.createdAt.getTime() - now.getTime()) > Time.Minute) { - console.log(util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))); - throw new Error('Time is off by over a minute'); + throw new Error( + `Time is off by over a minute: ${util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))}` + ); } const { log } = await Moderation.createModLogEntry({ diff --git a/src/listeners/track-manual-punishments/modlogSyncKick.ts b/src/listeners/track-manual-punishments/modlogSyncKick.ts index 7841686..59b43bc 100644 --- a/src/listeners/track-manual-punishments/modlogSyncKick.ts +++ b/src/listeners/track-manual-punishments/modlogSyncKick.ts @@ -34,8 +34,9 @@ export default class ModlogSyncKickListener extends BushListener { if (!first.executor || first.executor?.bot) return; if (Math.abs(first.createdAt.getTime() - now.getTime()) > Time.Minute) { - console.log(util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))); - throw new Error('Time is off by over a minute'); + throw new Error( + `Time is off by over a minute: ${util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))}` + ); } const { log } = await Moderation.createModLogEntry({ diff --git a/src/listeners/track-manual-punishments/modlogSyncTimeout.ts b/src/listeners/track-manual-punishments/modlogSyncTimeout.ts index 8a2c486..8ad8b79 100644 --- a/src/listeners/track-manual-punishments/modlogSyncTimeout.ts +++ b/src/listeners/track-manual-punishments/modlogSyncTimeout.ts @@ -36,8 +36,9 @@ export default class ModlogSyncTimeoutListener extends BushListener { if (!timeOut) return; if (Math.abs(first.createdAt.getTime() - now.getTime()) > Time.Minute) { - console.log(util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))); - throw new Error('Time is off by over a minute'); + throw new Error( + `Time is off by over a minute: ${util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))}` + ); } const newTime = <string | null>timeOut.new ? new Date(<string>timeOut.new) : null; diff --git a/src/listeners/track-manual-punishments/modlogSyncUnban.ts b/src/listeners/track-manual-punishments/modlogSyncUnban.ts index 70c7ba8..1c5de1d 100644 --- a/src/listeners/track-manual-punishments/modlogSyncUnban.ts +++ b/src/listeners/track-manual-punishments/modlogSyncUnban.ts @@ -33,8 +33,9 @@ export default class ModlogSyncUnbanListener extends BushListener { if (!first.executor || first.executor?.bot) return; if (Math.abs(first.createdAt.getTime() - now.getTime()) > Time.Minute) { - console.log(util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))); - throw new Error('Time is off by over a minute'); + throw new Error( + `Time is off by over a minute: ${util.humanizeDuration(Math.abs(first.createdAt.getTime() - now.getTime()))}` + ); } const { log } = await Moderation.createModLogEntry({ |