mirror of
https://github.com/openai/codex.git
synced 2026-12-06 01:10:58 +00:00
handle more API errors
Signed-off-by: Eason Goodale <easong@openai.com>
This commit is contained in:
@@ -955,6 +955,14 @@ export class AgentLoop {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Explicit check for OpenAI "server_error" types which are surfaced
|
||||
// when the backend encounters an unexpected exception. The SDK often
|
||||
// omits the HTTP status in this case (leaving it undefined) so we
|
||||
// must inspect the structured error fields instead.
|
||||
if (e.type === "server_error" || e.code === "server_error") {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (typeof e.status === "number" && e.status >= 500) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user