#[non_exhaustive]pub enum OpenAIError {
Http(String),
Api(String),
Parse(String),
Config(String),
}Expand description
OpenAI error type
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.
Http(String)
HTTP request error
Api(String)
API-returned error
Parse(String)
Response parse error
Config(String)
Configuration error (missing/malformed environment variables, etc.).
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
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()
Source§impl From<OpenAIError> for ProviderError
impl From<OpenAIError> for ProviderError
Source§fn from(e: OpenAIError) -> Self
fn from(e: OpenAIError) -> Self
Converts to this type from the input type.
Source§impl From<OpenAIError> for LcelError
Allow OpenAIError to convert into LcelError for LCEL pipeline compatibility.
impl From<OpenAIError> for LcelError
Allow OpenAIError to convert into LcelError for LCEL pipeline compatibility.
OpenAIChat’s Runnable uses OpenAIError directly as its Error type; without the
bridge, OpenAIChat cannot enter a pipe() chain (which needs R2::Error: Into<LcelError>).
Qwen / DeepSeek go through OpenAI-compatible endpoints, but they wrap OpenAIError into
ProviderError and bridge from there, already covered by the impl above.
Source§fn from(err: OpenAIError) -> Self
fn from(err: OpenAIError) -> Self
Converts to this type from the input type.
Source§impl From<ProviderError> for OpenAIError
impl From<ProviderError> for OpenAIError
Source§fn from(e: ProviderError) -> Self
fn from(e: ProviderError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OpenAIError
impl RefUnwindSafe for OpenAIError
impl Send for OpenAIError
impl Sync for OpenAIError
impl Unpin for OpenAIError
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more