Dont swallow error

This commit is contained in:
Nikolay Kim 2024-11-04 13:20:31 +05:00
parent ce1bf97068
commit e8aa08ef66
3 changed files with 6 additions and 3 deletions

View file

@ -4,6 +4,8 @@
* Use updated Service trait
* Don't swallow error when calling panic for read_response_json #443
## [2.7.0] - 2024-10-16
* Better handling for h2 remote payload

View file

@ -5,7 +5,7 @@ use crate::router::{IntoPattern, ResourceDef, Router};
use crate::service::boxed::{self, BoxService, BoxServiceFactory};
use crate::service::{chain_factory, dev::ServiceChainFactory, IntoServiceFactory};
use crate::service::{Identity, Middleware, Service, ServiceCtx, ServiceFactory};
use crate::util::{join, Extensions};
use crate::util::{join, select, Extensions};
use super::app::Filter;
use super::config::ServiceConfig;

View file

@ -244,8 +244,9 @@ where
{
let body = read_response::<S>(app, req).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)
})
}
/// Helper method for extractors testing