pub struct VldHttpError { /* private fields */ }Expand description
Framework-independent error produced by all vld HTTP adapters.
| Constructor | Status | Body |
|---|---|---|
validation / parse | 422 | ValidationErrorBody |
payload_too_large | 413 | ErrorBody |
unsupported_media_type / unsupported_form_media_type | 415 | ErrorWithMessage |
Adapters only convert status and body
into their framework’s response type.
Implementations§
Source§impl VldHttpError
impl VldHttpError
Sourcepub fn validation(error: VldError) -> Self
pub fn validation(error: VldError) -> Self
422 — schema validation failed.
Sourcepub fn parse(message: impl Into<String>) -> Self
pub fn parse(message: impl Into<String>) -> Self
422 — the input could not be parsed (malformed JSON, bad UTF-8, …).
Sourcepub fn payload_too_large() -> Self
pub fn payload_too_large() -> Self
413 — the body exceeds the size limit.
error holds a single ParseError issue
"Payload too large" (also what Display prints).
Sourcepub fn unsupported_media_type() -> Self
pub fn unsupported_media_type() -> Self
415 — a JSON body was sent without a JSON Content-Type.
error holds a single ParseError issue with
UNSUPPORTED_MEDIA_TYPE_MESSAGE.
Sourcepub fn unsupported_form_media_type() -> Self
pub fn unsupported_form_media_type() -> Self
415 — a form body was sent without
Content-Type: application/x-www-form-urlencoded.
error holds a single ParseError issue with
UNSUPPORTED_FORM_MEDIA_TYPE_MESSAGE.
Sourcepub fn into_error(self) -> VldError
pub fn into_error(self) -> VldError
Consume and return the underlying validation error.
Trait Implementations§
Source§impl Clone for VldHttpError
impl Clone for VldHttpError
Source§impl Debug for VldHttpError
impl Debug for VldHttpError
Source§impl Display for VldHttpError
impl Display for VldHttpError
Source§impl Error for VldHttpError
impl Error for VldHttpError
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 Forget for VldHttpError
impl Freeze for VldHttpError
impl RefUnwindSafe for VldHttpError
impl Send for VldHttpError
impl Sync for VldHttpError
impl Unpin for VldHttpError
impl UnsafeUnpin for VldHttpError
impl UnwindSafe for VldHttpError
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