#[non_exhaustive]pub enum ModelError {
Api {
code: u16,
status: String,
message: String,
details: Vec<Value>,
},
Transport(Box<dyn Error + Send + Sync>),
Decode {
message: String,
body_prefix: String,
},
EmptyResponse,
Config(String),
Other(Box<dyn Error + Send + Sync>),
}Expand description
Errors produced by model backends.
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.
Api
The API returned an error response.
Fields
Transport(Box<dyn Error + Send + Sync>)
The request could not be sent or the response could not be read.
Decode
The response body could not be decoded.
Fields
§
body_prefix: StringThe start of the offending body (see body_prefix).
EmptyResponse
The model returned no response.
Config(String)
Invalid configuration.
Other(Box<dyn Error + Send + Sync>)
Any other error.
Trait Implementations§
Source§impl Debug for ModelError
impl Debug for ModelError
Source§impl Display for ModelError
impl Display for ModelError
Source§impl Error for ModelError
impl Error for ModelError
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 !RefUnwindSafe for ModelError
impl !UnwindSafe for ModelError
impl Forget for ModelError
impl Freeze for ModelError
impl Move for ModelError
impl Send for ModelError
impl Sync for ModelError
impl Unpin for ModelError
impl UnsafeUnpin for ModelError
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