#[non_exhaustive]pub enum OpenAiEmbedderError {
Network {
message: String,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
},
HttpStatus {
status: u16,
body: String,
},
Malformed(String),
Config(String),
Credential(Error),
Serde(Error),
}Expand description
Errors that can surface from OpenAiEmbedder.
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.
Network
Network / HTTP failure reaching the OpenAI API. Carries the
underlying reqwest::Error chain.
Fields
HttpStatus
Non-2xx HTTP status from OpenAI. Body is truncated to keep log volume bounded under malicious upstream payloads.
Malformed(String)
Server returned a malformed JSON body (missing data, vector
dimension mismatch, etc.).
Config(String)
Configuration error — invalid base URL, missing credentials, dimension mismatch at build time.
Credential(Error)
Credential resolution failed.
Serde(Error)
JSON encode/decode failure.
Implementations§
Trait Implementations§
Source§impl Debug for OpenAiEmbedderError
impl Debug for OpenAiEmbedderError
Source§impl Display for OpenAiEmbedderError
impl Display for OpenAiEmbedderError
Source§impl Error for OpenAiEmbedderError
impl Error for OpenAiEmbedderError
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 OpenAiEmbedderError
impl From<Error> for OpenAiEmbedderError
Source§impl From<OpenAiEmbedderError> for Error
impl From<OpenAiEmbedderError> for Error
Source§fn from(err: OpenAiEmbedderError) -> Self
fn from(err: OpenAiEmbedderError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OpenAiEmbedderError
impl !RefUnwindSafe for OpenAiEmbedderError
impl Send for OpenAiEmbedderError
impl Sync for OpenAiEmbedderError
impl Unpin for OpenAiEmbedderError
impl UnsafeUnpin for OpenAiEmbedderError
impl !UnwindSafe for OpenAiEmbedderError
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