pub enum ProxyError {
UnknownModel(String),
NoHealthyDeployment(String),
Upstream {
status: u16,
body: String,
retry_after_secs: Option<u64>,
},
RateLimited,
BudgetExceeded,
ModelNotAllowed,
Transport(String),
Unauthorized,
BadRequest(String),
Internal(Error),
}Expand description
Errors from request parsing, translation, and (in an embedder’s runtime)
upstream transport. http_status/log_status map each variant to the wire
and log mappings an ingress surface would use; the variants are shared here
so a mapped request carries one error type end to end.
Variants§
UnknownModel(String)
NoHealthyDeployment(String)
Upstream
Fields
RateLimited
BudgetExceeded
ModelNotAllowed
Transport(String)
BadRequest(String)
Internal(Error)
Implementations§
Source§impl ProxyError
impl ProxyError
pub fn upstream(status: u16, body: String) -> Self
Sourcepub fn log_status(&self) -> i64
pub fn log_status(&self) -> i64
Status recorded in a spend/request log for this failure. Unlike http_status(), a client-side disconnect mid-stream is logged as 503 (the client’s problem), and unknown-internal as 500 — the log table intentionally diverges from the wire mapping.
Sourcepub fn http_status(&self) -> u16
pub fn http_status(&self) -> u16
HTTP status for this error on the wire. Individual dialects may override (the Anthropic dialect maps BudgetExceeded to Anthropic-style 429 — see dialect/anthropic/out.rs).
Trait Implementations§
Source§impl Debug for ProxyError
impl Debug for ProxyError
Source§impl Display for ProxyError
impl Display for ProxyError
Source§impl Error for ProxyError
impl Error for ProxyError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ProxyError
impl RefUnwindSafe for ProxyError
impl Send for ProxyError
impl Sync for ProxyError
impl Unpin for ProxyError
impl UnsafeUnpin for ProxyError
impl UnwindSafe for ProxyError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more