aboutsummaryrefslogtreecommitdiff
path: root/src/request.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-01-20 11:41:03 +0100
committerMartin Fischer <martin@push-f.com>2021-01-20 11:53:26 +0100
commitb886de1afc0b90d7ca27db9d5c7dabddbe3d7ee0 (patch)
tree6707f203caafd85a07c5842a2ac8146b7c325981 /src/request.rs
parentc55c4a49414f9dbcb637ba5ea765f4af9aebf807 (diff)
introduce Error::Simple and Error::Response
bump version to 0.2.2
Diffstat (limited to 'src/request.rs')
-rw-r--r--src/request.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/request.rs b/src/request.rs
index 79ca2ae..c874ab5 100644
--- a/src/request.rs
+++ b/src/request.rs
@@ -169,12 +169,12 @@ pub mod error {
#[derive(Error, Debug)]
#[error("query deserialize error: {0}")]
pub struct QueryError(pub serde_urlencoded::de::Error);
- impl_into_http_error!(QueryError, StatusCode::BAD_REQUEST);
+ impl_into_error_simple!(QueryError, StatusCode::BAD_REQUEST);
#[derive(Error, Debug)]
#[error("failed to read body")]
pub struct BodyError(pub hyper::Error);
- impl_into_http_error!(BodyError, StatusCode::BAD_REQUEST);
+ impl_into_error_simple!(BodyError, StatusCode::BAD_REQUEST);
#[derive(Error, Debug)]
#[error("expected Content-Type {expected} but received {}", received.as_ref().unwrap_or(&"nothing".to_owned()))]
@@ -194,7 +194,7 @@ pub mod error {
#[error("form deserialize error: {0}")]
Deserialize(#[from] serde_urlencoded::de::Error),
}
- impl_into_http_error!(FormError, StatusCode::BAD_REQUEST);
+ impl_into_error_simple!(FormError, StatusCode::BAD_REQUEST);
#[derive(Error, Debug)]
pub enum CsrfProtectedFormError {
@@ -213,5 +213,5 @@ pub mod error {
#[error("{0}")]
Csrf(#[from] CsrfError),
}
- impl_into_http_error!(CsrfProtectedFormError, StatusCode::BAD_REQUEST);
+ impl_into_error_simple!(CsrfProtectedFormError, StatusCode::BAD_REQUEST);
} \ No newline at end of file