From 4b8181476c8f6ccedf85f20e9085ae607197e7d8 Mon Sep 17 00:00:00 2001 From: Christopher Armstrong Date: Mon, 12 Feb 2018 23:55:44 -0600 Subject: [PATCH] consistently use `#[cause]` and display causing errors (#73) --- src/error.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/error.rs b/src/error.rs index d166636a7..da6745fd5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -403,8 +403,8 @@ pub enum UrlencodedError { #[fail(display="Content type error")] ContentType, /// Payload error - #[fail(display="Error that occur during reading payload")] - Payload(PayloadError), + #[fail(display="Error that occur during reading payload: {}", _0)] + Payload(#[cause] PayloadError), } /// Return `BadRequest` for `UrlencodedError` @@ -435,11 +435,11 @@ pub enum JsonPayloadError { #[fail(display="Content type error")] ContentType, /// Deserialize error - #[fail(display="Json deserialize error")] - Deserialize(JsonError), + #[fail(display="Json deserialize error: {}", _0)] + Deserialize(#[cause] JsonError), /// Payload error - #[fail(display="Error that occur during reading payload")] - Payload(PayloadError), + #[fail(display="Error that occur during reading payload: {}", _0)] + Payload(#[cause] PayloadError), } /// Return `BadRequest` for `UrlencodedError`