mirror of
https://github.com/openai/codex.git
synced 2026-10-26 16:00:02 +00:00
## What changed - Wrap `CodexErrorDetails` and an optional retry delay in `CodexErr`, allowing any mapped error to preserve server-provided retry timing. - Generate the payload-free `CodexErrKind` classification alongside the error details and reuse it for analytics. - Update error handling sites to inspect `CodexErr::details()` while preserving existing display, debug, protocol mapping, and retryability behavior. ## Testing - Add coverage for legacy debug formatting, error-specific retryability, and retry-delay propagation through API error mapping. GitOrigin-RevId: d3ab8a305f2a2ee21d0c0a8c8c388b06dda9c59a
10 lines
353 B
Rust
10 lines
353 B
Rust
use super::*;
|
|
use codex_protocol::error::CodexErrorDetails;
|
|
|
|
pub(super) fn environment_selection_error(err: CodexErr) -> JSONRPCErrorError {
|
|
match err.details() {
|
|
CodexErrorDetails::InvalidRequest(message) => invalid_request(message.clone()),
|
|
_ => internal_error(format!("failed to validate environment selections: {err}")),
|
|
}
|
|
}
|