pub enum SamvadSetuError {
Http {
status: u16,
body: String,
},
Provider {
error_type: String,
message: String,
param: Option<String>,
code: Option<String>,
},
RateLimit {
retry_after_secs: Option<u64>,
message: String,
},
Parse {
message: String,
raw_response: Option<String>,
},
Config(String),
Auth(String),
Timeout,
Network(String),
BatchNotComplete {
batch_id: String,
status: String,
},
UnsupportedFeature {
provider: String,
feature: String,
},
}Expand description
All errors that can arise when calling an LLM API.
Variants§
Http
The server returned a non-success HTTP status.
Provider
The provider returned a structured error in the response body.
Fields
RateLimit
The API rate limit was exceeded.
Fields
Parse
Failed to serialize the request or deserialize the response.
Fields
Config(String)
A required field was missing or invalid in the library configuration.
Auth(String)
Authentication failed (missing or invalid API key).
Timeout
The request timed out before a response was received.
Network(String)
A lower-level network error occurred.
BatchNotComplete
A batch job was queried but has not finished yet.
UnsupportedFeature
The requested feature is not supported by this provider.
Trait Implementations§
Source§impl Clone for SamvadSetuError
impl Clone for SamvadSetuError
Source§fn clone(&self) -> SamvadSetuError
fn clone(&self) -> SamvadSetuError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SamvadSetuError
impl Debug for SamvadSetuError
Source§impl Display for SamvadSetuError
impl Display for SamvadSetuError
Source§impl Error for SamvadSetuError
impl Error for SamvadSetuError
1.30.0 · 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 SamvadSetuError
impl RefUnwindSafe for SamvadSetuError
impl Send for SamvadSetuError
impl Sync for SamvadSetuError
impl Unpin for SamvadSetuError
impl UnsafeUnpin for SamvadSetuError
impl UnwindSafe for SamvadSetuError
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