1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2025-01-04 14:28:50 +00:00

add error to message in test helper func (#1812)

This commit is contained in:
Petar Dambovaliev 2020-12-04 20:57:56 +01:00 committed by GitHub
parent d0c6ca7671
commit b75a9b7a20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -1,6 +1,11 @@
# Changes # Changes
## Unreleased - 2020-xx-xx ## 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 ## 3.3.2 - 2020-12-01

View file

@ -269,8 +269,9 @@ where
{ {
let body = read_body(res).await; let body = read_body(res).await;
serde_json::from_slice(&body) serde_json::from_slice(&body).unwrap_or_else(|e| {
.unwrap_or_else(|_| panic!("read_response_json failed during deserialization")) panic!("read_response_json failed during deserialization: {}", e)
})
} }
pub async fn load_stream<S>(mut stream: S) -> Result<Bytes, Error> pub async fn load_stream<S>(mut stream: S) -> Result<Bytes, Error>