pub enum ApiError<E>{
Client {
source: E,
},
Body {
source: BodyError,
},
Json {
source: Error,
},
Server {
msg: String,
},
Internal {
status: StatusCode,
data: Vec<u8>,
},
ServerObject {
obj: Value,
},
UnknownObject {
obj: Value,
},
DataType {
source: Error,
typename: &'static str,
},
}Variants§
Client
Client has encountered an error
Fields
§
source: EBody
Body data creation failed
Json
JSON response couldn’t be parsed
Server
Server returned an error message
Internal
Server returned non-JSON error
ServerObject
Server returned an error object
UnknownObject
Server returned unknown object
DataType
Could not parse JSON
Implementations§
Trait Implementations§
Source§impl<E> Error for ApiError<E>
impl<E> Error for ApiError<E>
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<E> Freeze for ApiError<E>where
E: Freeze,
impl<E> !RefUnwindSafe for ApiError<E>
impl<E> Send for ApiError<E>
impl<E> Sync for ApiError<E>
impl<E> Unpin for ApiError<E>where
E: Unpin,
impl<E> !UnwindSafe for ApiError<E>
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