From b75a9b7a20b8cdc24842d38c7aa406e2b49f90c7 Mon Sep 17 00:00:00 2001 From: Petar Dambovaliev Date: Fri, 4 Dec 2020 20:57:56 +0100 Subject: [PATCH] add error to message in test helper func (#1812) --- CHANGES.md | 5 +++++ src/test.rs | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d9984224..87c021b1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ # Changes ## Unreleased - 2020-xx-xx +### Fixed +* added the actual parsing error to `test::read_body_json` [#1812] + +[#1812]: https://github.com/actix/actix-web/pull/1812 + ## 3.3.2 - 2020-12-01 diff --git a/src/test.rs b/src/test.rs index ee51b71e..cff6c3e5 100644 --- a/src/test.rs +++ b/src/test.rs @@ -269,8 +269,9 @@ where { let body = read_body(res).await; - serde_json::from_slice(&body) - .unwrap_or_else(|_| panic!("read_response_json failed during deserialization")) + serde_json::from_slice(&body).unwrap_or_else(|e| { + panic!("read_response_json failed during deserialization: {}", e) + }) } pub async fn load_stream(mut stream: S) -> Result