diff options
Diffstat (limited to 'packages/shared/log.ts')
| -rw-r--r-- | packages/shared/log.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/shared/log.ts b/packages/shared/log.ts index 35a3590..ce50dd5 100644 --- a/packages/shared/log.ts +++ b/packages/shared/log.ts @@ -27,3 +27,11 @@ export const log = ( `\x1b[37m${timestamp}\x1b[0m ${levelColor}${level}\x1b[0m \x1b[1m${unit}\x1b[22m \x1b[37m> ${message}\x1b[0m`, ); }; + +export const logUnexpectedDiscordAPIError = (unit: string, error: unknown) => { + log( + unit, + `Unexpected Discord API error: ${error instanceof Error ? error.message : String(error)}`, + LogLevel.Error, + ); +}; |