#[non_exhaustive]pub enum BackendError {
InvalidRequest(String),
Serialization {
source: Error,
},
Provider {
family: &'static str,
source: BoxError,
},
}Expand description
Operating an already-constructed backend failed: a runtime execution failure.
Returned by chat completion, streaming, prepare/send/parse, rendering, model catalog, and
balance calls — everything that drives a live backend. Construction failures are
BackendConstructError; static capability gating is CapabilityError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRequest(String)
The request was invalid before it reached the provider.
Serialization
Failed to serialize a request payload or render provider-specific types.
Provider
The underlying provider SDK returned an error.
Carries the backend family for attribution and the provider error as a boxed source (see
BoxError for why this is not a concrete ProviderError).
Implementations§
Source§impl BackendError
impl BackendError
Sourcepub fn invalid_request(message: impl Into<String>) -> Self
pub fn invalid_request(message: impl Into<String>) -> Self
Creates an invalid-request error with a stable, user-facing message.
Sourcepub fn serialization(source: Error) -> Self
pub fn serialization(source: Error) -> Self
Creates a serialization error wrapping a serde_json failure.
Trait Implementations§
Source§impl Debug for BackendError
impl Debug for BackendError
Source§impl Display for BackendError
impl Display for BackendError
Source§impl Error for BackendError
impl Error for BackendError
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()