diff options
| author | Fuwn <[email protected]> | 2025-10-20 21:49:53 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-10-20 21:49:59 -0700 |
| commit | 8fbf65a15c023e106c2a78bf2372c60ffa77b175 (patch) | |
| tree | 354671e29c8b4d2f8007b942f65dba9bc58cea83 | |
| parent | feat(shared): Add logging framework (diff) | |
| download | umabotdiscord-8fbf65a15c023e106c2a78bf2372c60ffa77b175.tar.xz umabotdiscord-8fbf65a15c023e106c2a78bf2372c60ffa77b175.zip | |
feat(shared:log): Add standard Discord API error log
| -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, + ); +}; |