Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache panics with error handling #365

Closed
lostb1t opened this issue Aug 13, 2023 · 1 comment
Closed

Cache panics with error handling #365

lostb1t opened this issue Aug 13, 2023 · 1 comment

Comments

@lostb1t
Copy link
Contributor

lostb1t commented Aug 13, 2023

Router::new()
                .path(".test)
                .hoop(default_cache())
                .get(test),
        )

#[handler]
pub async fn test(
    req: &mut Request,
    res: &mut Response,
) -> Result<(), salvo::Error> {
 Err(salvo::http::StatusError::internal_server_error().into())
}

Results in panic:

thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Other("unsupported body type"), /Users/sarendsen/.cargo/registry/src/index.crates.io-6f17d22bba15001f/salvo-cache-0.50.3/src/lib.rs:288:67

chrislearn added a commit to chrislearn/salvo that referenced this issue Aug 13, 2023
chrislearn added a commit that referenced this issue Aug 13, 2023
* fix(cache): Cache panics with error handling #365

* fix cahce panic
@chrislearn
Copy link
Member

Fixed in version 0.50.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants