#[non_exhaustive]pub enum OpenAIError {
Show 16 variants
Api(ApiError),
Http(String),
Ws(String),
WsInvalidMessage(String),
Internal(String),
InvalidArgument(String),
MissingArgument(String),
MissingEnvironment(String),
MissingHeader(String),
MissingFile(String),
File(String),
Network(String),
Timeout(String),
Stream(String),
Unknown(String),
RateLimit(String),
}Expand description
Represents all possible errors that can occur when interacting with the OpenAI API.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Api(ApiError)
An error returned by the OpenAI API.
Http(String)
An error that occurred during HTTP communication.
Ws(String)
An error that occurred during WebSocket communication.
WsInvalidMessage(String)
An error that occurred during WebSocket communication due to an invalid message.
Internal(String)
An error that occurred during serialization or deserialization.
InvalidArgument(String)
An error indicating an invalid argument was provided.
MissingArgument(String)
An error indicating a missing required argument.
MissingEnvironment(String)
An error indicating a missing environment variable.
MissingHeader(String)
An error indicating a missing header.
MissingFile(String)
An error indicating a missing file.
File(String)
An error indicating a file operation failed.
Network(String)
An error indicating a network issue.
Timeout(String)
An error indicating a timeout.
Stream(String)
An error related to streaming data.
Unknown(String)
An unknown error.
RateLimit(String)
A rate limiting error.
Trait Implementations§
Source§impl Clone for OpenAIError
impl Clone for OpenAIError
Source§fn clone(&self) -> OpenAIError
fn clone(&self) -> OpenAIError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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
1.30.0 · 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
Source§impl From<Error<OpenAIError>> for OpenAIError
impl From<Error<OpenAIError>> for OpenAIError
Source§fn from(error: Error<OpenAIError>) -> Self
fn from(error: Error<OpenAIError>) -> Self
Source§impl From<Error> for OpenAIError
impl From<Error> for OpenAIError
Source§impl From<Error> for OpenAIError
impl From<Error> for OpenAIError
Source§impl PartialEq for OpenAIError
impl PartialEq for OpenAIError
impl StructuralPartialEq for OpenAIError
Auto Trait Implementations§
impl Freeze for OpenAIError
impl RefUnwindSafe for OpenAIError
impl Send for OpenAIError
impl Sync for OpenAIError
impl Unpin for OpenAIError
impl UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
impl<C, E> EntryToVal<C> for Ewhere
C: Collection<Entry = E>,
Source§type Val = <C as Collection>::Val
type Val = <C as Collection>::Val
Entry in complex collections.
For example, in a HashMap, while Entry might be a ( key, value ) tuple, Val might only be the value part.Source§fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
fn entry_to_val(self) -> <E as EntryToVal<C>>::Val
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.
Source§impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
impl<C, Val> ValToEntry<C> for Valwhere
C: CollectionValToEntry<Val>,
Source§fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
fn val_to_entry(self) -> <C as CollectionValToEntry<Val>>::Entry
Invokes the val_to_entry function of the CollectionValToEntry trait to convert the value to an entry.
Source§type Entry = <C as CollectionValToEntry<Val>>::Entry
type Entry = <C as CollectionValToEntry<Val>>::Entry
Entry is defined by the Collection trait.