Issue with expected Error type mismatch #3674
Replies: 1 comment 3 replies
-
You mean that that body has an error type of It would help to learn a little about what the error in a body will do. If after returning some response headers, you start reading the file, and part way through it has an error, you'll want to signal that the response body cannot be completed. So you return an error. hyper will basically abort the response according to the way the HTTP protocol allows (depends on if its HTTP/1 or 2). But hyper doesn't really care what the exact body error is. So, you could just make a |
Beta Was this translation helpful? Give feedback.
-
I have an issue where a function is returning a response with a
std::io::Error
when I would like for that error to be ahyper::Error
.The idea is for the function to be able to return an HTML page on a GET request. Where I'm running into a problem is it looks like the
BoxBody
is trying to returnstd::io::Error
in the Option by default.I'd like to do this in a way that returns a
hyper::Error
since the function it's feeding into is expecting it, so if my approach won't get me there I'd like to know.Any suggestions would be much appreciated. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions