pub enum Error {
Json(Error),
Io(Error),
Protocol(String),
ConnectionClosed,
Deserialization(String),
ProcessFailed(i32, String),
JsonRpc {
code: i64,
message: String,
},
ServerClosed,
BinaryNotFound {
name: String,
},
Unknown(String),
}Expand description
All possible errors from codex-codes operations.
Variants§
Json(Error)
JSON serialization or deserialization failed.
Returned when request parameters can’t be serialized or response payloads don’t match expected types.
Io(Error)
An I/O error occurred communicating with the app-server process.
Common causes: process not found, pipe broken, permission denied.
Protocol(String)
A protocol-level error (e.g., missing stdin/stdout pipes).
ConnectionClosed
The app-server connection was closed unexpectedly.
Deserialization(String)
A message from the server could not be deserialized.
Includes the raw message text for debugging. If you encounter this, please report it — it likely indicates a protocol change.
ProcessFailed(i32, String)
The app-server process exited with a non-zero status.
JsonRpc
The server returned a JSON-RPC error response.
Contains the error code and message from the server. See the Codex CLI docs for error code meanings.
ServerClosed
The server closed the connection (EOF on stdout).
Returned by request() if the server exits mid-conversation.
BinaryNotFound
The CLI binary could not be found on PATH.
Unknown(String)
An unclassified error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()