#[non_exhaustive]pub enum OpenAIError {
Config(String),
Connection(String),
Timeout,
Api(Box<ApiError>),
Stream(String),
Json(Error),
Http(Error),
}Expand description
All errors produced by this crate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Config(String)
Client construction / configuration problem (e.g. missing API key).
Connection(String)
Failed to reach the server.
Timeout
The request timed out.
Api(Box<ApiError>)
The API returned a 4xx/5xx response.
(Boxed to keep Result sizes small.)
Stream(String)
An error occurred while consuming a streaming response.
Json(Error)
Failed to (de)serialize JSON.
Http(Error)
Any other HTTP-level failure.
Trait Implementations§
Source§impl Debug for OpenAIError
impl Debug for OpenAIError
Source§impl Display for OpenAIError
impl Display for OpenAIError
Source§impl Error for OpenAIError
impl Error for OpenAIError
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()
Source§impl From<Error> for OpenAIError
impl From<Error> for OpenAIError
Auto Trait Implementations§
impl !RefUnwindSafe for OpenAIError
impl !UnwindSafe for OpenAIError
impl Freeze for OpenAIError
impl Send for OpenAIError
impl Sync for OpenAIError
impl Unpin for OpenAIError
impl UnsafeUnpin for OpenAIError
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