From 6c9710cb76347b79a2463ec0ca5bde59177b531f Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Mon, 14 Mar 2022 20:44:16 -0400 Subject: feat(logging): over complicated repl --- src/listeners/track-manual-punishments/modlogSyncBan.ts | 5 +++-- src/listeners/track-manual-punishments/modlogSyncKick.ts | 5 +++-- src/listeners/track-manual-punishments/modlogSyncTimeout.ts | 5 +++-- src/listeners/track-manual-punishments/modlogSyncUnban.ts | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/listeners/track-manual-punishments') 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 = timeOut.new ? new Date(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({ -- cgit