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:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user