chore: drop full error stack traces from chat error logs

Shorten the ✗ ERROR 502 / stream ERROR lines to the message only; the
multi-KB next-dev stack trace polluted the console on every provider error.
This commit is contained in:
MUH. IQRAM BAHRING
2026-08-07 06:39:54 +08:00
parent fa679a676d
commit c1bbe446de
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -422,7 +422,7 @@ export async function handleChatCore({ body, modelInfo, credentials, log, onCred
} }
const errMsg = formatProviderError(error, provider, model, HTTP_STATUS.BAD_GATEWAY); const errMsg = formatProviderError(error, provider, model, HTTP_STATUS.BAD_GATEWAY);
if (log?.errorLine) { if (log?.errorLine) {
log.errorLine(reqTag, "✗", `ERROR 502 · ${provider}/${model} · ${Date.now() - requestStartTime}ms\n ${errMsg}${error.stack ? `\n ${error.stack}` : ""}`); log.errorLine(reqTag, "✗", `ERROR 502 · ${provider}/${model} · ${Date.now() - requestStartTime}ms\n ${errMsg}`);
} }
return createErrorResult(HTTP_STATUS.BAD_GATEWAY, errMsg, error?.resetsAtMs || undefined); return createErrorResult(HTTP_STATUS.BAD_GATEWAY, errMsg, error?.resetsAtMs || undefined);
} }
+1 -1
View File
@@ -78,7 +78,7 @@ export function createStreamController({ onDisconnect, onError, log, provider, m
return; return;
} }
logStream("✗", `ERROR: ${error.message}${error.stack ? `\n ${error.stack}` : ""}`, true); logStream("✗", `ERROR: ${error.message}`, true);
onError?.(error); onError?.(error);
}, },