Download codex-rs/codex-api/src/error.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/codex-api/src/error.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/codex-api/src/error.rs
-
curl -L -o error.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/codex-api/src/error.rs
1.48 kB
| use crate::rate_limits::RateLimitError; | |
| use codex_client::TransportError; | |
| use codex_protocol::protocol::MisalignmentErrorDetails; | |
| use http::StatusCode; | |
| use std::time::Duration; | |
| use thiserror::Error; | |
| pub enum ApiError { | |
| Transport( TransportError), | |
| Api { status: StatusCode, message: String }, | |
| Stream(String), | |
| ContextWindowExceeded, | |
| QuotaExceeded, | |
| UsageNotIncluded, | |
| Retryable { | |
| message: String, | |
| delay: Option<Duration>, | |
| }, | |
| RateLimitExceeded { | |
| message: String, | |
| delay: Option<Duration>, | |
| }, | |
| RateLimit(String), | |
| InvalidRequest { message: String }, | |
| CyberPolicy { message: String }, | |
| MisalignmentPolicyViolation { | |
| message: String, | |
| misalignment: Option<MisalignmentErrorDetails>, | |
| }, | |
| ServerOverloaded, | |
| } | |
| impl From<RateLimitError> for ApiError { | |
| fn from(err: RateLimitError) -> Self { | |
| Self::RateLimit(err.to_string()) | |
| } | |
| } | |