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:
@@ -450,7 +450,7 @@ async function processIndividualFallback(
|
|||||||
lastError = error instanceof Error ? error.message : String(error);
|
lastError = error instanceof Error ? error.message : String(error);
|
||||||
|
|
||||||
// Log error with responseLogger
|
// Log error with responseLogger
|
||||||
logModerationError([messageId], config.AI_LLM_MODEL, error, {
|
logModerationError([messageId], config.AI_LLM_MODEL, error as Error | string, {
|
||||||
phase: "individual_fallback",
|
phase: "individual_fallback",
|
||||||
conversationKey,
|
conversationKey,
|
||||||
exhaustedOnIncomplete,
|
exhaustedOnIncomplete,
|
||||||
|
|||||||
@@ -796,7 +796,7 @@ async function callModerationLLM(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Log error with responseLogger
|
// Log error with responseLogger
|
||||||
logModerationError(targetIds, config.AI_LLM_MODEL, parseError, {
|
logModerationError(targetIds, config.AI_LLM_MODEL, parseError as Error | string, {
|
||||||
phase: "parse_response",
|
phase: "parse_response",
|
||||||
label,
|
label,
|
||||||
contentLength: state.lastInvalidContent.length,
|
contentLength: state.lastInvalidContent.length,
|
||||||
|
|||||||
Reference in New Issue
Block a user