Skip to content

How to either create a hyper::Error or handle hyper::http::Error #2802

Answered by seanmonstar
ristillu asked this question in Q&A
Discussion options

You must be logged in to vote

A hyper::Error is not meant to be something that a user creates. You don't need to return one in your server handler. I imagine you probably want to because you also are handling request body errors? Here's what I would do: change your service error to a dynamic error type. Maybe anyhow, or even just Box<dyn std::error::Error>.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ristillu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants