pub enum GemError {
EmptyApiResponse,
ConnectionError(Error),
ResponseError((Error, StatusCode)),
PromptFeedbackBlocked,
AllCandidatesBlocked,
GeminiAPIError(Error),
ParsingError(Error),
FeedbackError(String),
StreamError(String),
FileError(String),
}Expand description
Represents errors that can occur in the Gem-rs library.
Variants§
EmptyApiResponse
Indicates that an empty response was received from the API.
ConnectionError(Error)
Represents a connection error when communicating with the API.
ResponseError((Error, StatusCode))
Represents an error in the API response, including the HTTP status code.
PromptFeedbackBlocked
Indicates that the prompt feedback was blocked by the API.
AllCandidatesBlocked
Indicates that all candidate responses were blocked by the API.
GeminiAPIError(Error)
Represents an error returned by the Gemini API.
ParsingError(Error)
Represents an error that occurred while parsing the API response.
FeedbackError(String)
Represents an error that occurred during the feedback process.
StreamError(String)
Represents an error that occurred while streaming data.
FileError(String)
Represents an error related to file operations.
Trait Implementations§
Source§impl Error for GemError
impl Error for GemError
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 GemError
impl !RefUnwindSafe for GemError
impl Send for GemError
impl Sync for GemError
impl Unpin for GemError
impl !UnwindSafe for GemError
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