pub enum Error<T> {
Reqwest(Error),
Serde(Error),
Io(Error),
ResponseError(ResponseContent<T>),
}Variants§
Implementations§
Source§impl<T> Error<T>
impl<T> Error<T>
Sourcepub fn error_messages(&self) -> Vec<String>
pub fn error_messages(&self) -> Vec<String>
The error messages carried by the response body, normalized to a flat
Vec<String> regardless of which envelope shape the API returned
({"errors": "..."}, {"errors": ["..."]},
{"errors": [{"code": ..., "title": ...}]}, or an object map such as
{"errors": {"invalid_aliases": {...}}}, surfaced as "<key>: <value>"
entries). Returns an empty Vec for non-response errors (network, serde,
IO) or when the body is not a recognizable error envelope. The raw
response remains available on the ResponseError variant.
Trait Implementations§
Source§impl<T: Debug> Error for Error<T>
impl<T: Debug> Error for Error<T>
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<T> !RefUnwindSafe for Error<T>
impl<T> !UnwindSafe for Error<T>
impl<T> Freeze for Error<T>where
ResponseContent<T>: Freeze,
impl<T> Send for Error<T>where
ResponseContent<T>: Send,
impl<T> Sync for Error<T>where
ResponseContent<T>: Sync,
impl<T> Unpin for Error<T>where
ResponseContent<T>: Unpin,
impl<T> UnsafeUnpin for Error<T>where
ResponseContent<T>: UnsafeUnpin,
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