fix(discord-gateway): resolve type errors in error logging - cast unknown error types to Error | string for logModerationError calls

- aiAnalyzer.ts: cast error to Error | string in individual fallback phase
- llmModerationClient.ts: cast parseError to Error | string in parse response phase

Fixes GitHub Actions build failure (exit code 2)
This commit is contained in:
MythEclipse
2026-06-02 12:30:59 +07:00
parent e4302c22b4
commit 1acd452a2c
2 changed files with 2 additions and 2 deletions
@@ -450,7 +450,7 @@ async function processIndividualFallback(
lastError = error instanceof Error ? error.message : String(error);
// Log error with responseLogger
logModerationError([messageId], config.AI_LLM_MODEL, error, {
logModerationError([messageId], config.AI_LLM_MODEL, error as Error | string, {
phase: "individual_fallback",
conversationKey,
exhaustedOnIncomplete,
@@ -796,7 +796,7 @@ async function callModerationLLM(
);
// Log error with responseLogger
logModerationError(targetIds, config.AI_LLM_MODEL, parseError, {
logModerationError(targetIds, config.AI_LLM_MODEL, parseError as Error | string, {
phase: "parse_response",
label,
contentLength: state.lastInvalidContent.length,