Skip to content

Commit

Permalink
Dont swallow error
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Nov 4, 2024
1 parent ce1bf97 commit e8aa08e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ntex/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ntex/src/web/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions ntex/src/web/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 248 in ntex/src/web/test.rs

View check run for this annotation

Codecov / codecov/patch

ntex/src/web/test.rs#L248

Added line #L248 was not covered by tests
})
}

/// Helper method for extractors testing
Expand Down

0 comments on commit e8aa08e

Please sign in to comment.