-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Provide introspection on hyper::Error #1542
Comments
I saw mention of this in IRC, it seems you can't downcast the cause because What if |
That'd be nice, but is there a particular reason you don't want to expose the |
I'm not especially against some form of |
Oh, yeah, I think having both is probably a good idea! I think my concern about |
I have an application in which I want to try to set up a server on a specific port, but if that port is taken (i.e., an
AddrInUse
error is raised), it should fall back to any port (i.e., port 0). Unfortunately, since hyper's error type is now opaque (as of 5d3c472), I can no longer easily see if that was the cause of an error raised byServer::try_bind
.While I could construct a
TcpListener
myself and then pass that listener'sIncoming
toServer::builder
, that's an unfortunate amount of extra boilerplate. Perhaps it would make sense to expose anas_io_error(&self) -> Option<&io::Error>
onhyper::Error
?The text was updated successfully, but these errors were encountered: