Skip to content

Commit

Permalink
add error to message in test helper func (#1812)
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-dambovaliev authored Dec 4, 2020
1 parent d0c6ca7 commit b75a9b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<S>(mut stream: S) -> Result<Bytes, Error>
Expand Down

0 comments on commit b75a9b7

Please sign in to comment.