-
Notifications
You must be signed in to change notification settings - Fork 190
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
Document which Error a Transport is supposed to use #1029
Comments
@ijackson let transport = self
.connector
.connect(details, None)?
.ok_or(Error::ConnectionFailed)?; If there is an Can you repro with |
Oh. I think you are saying that That wasn't clear to us from the description. My co-contributor and I thought that this was the right variant to return from our
Connections across the Tor network can fail for a much wider variety of reasons than an underlying Our
This bland error message was a prediction of the behaviour of our whole program, not seen in use. Although it seems an obvious consequence of the code we've written. I now understand that to be wrong. |
Ah, I see. I think as much as possible the strategy should be:
However, I can see we might want to introduce some other error you can use to provide a more descriptive string. |
Thanks for the reply. I think i will advise my collaborator to just wrap our errors in I'm left wondering if you want to expand on your docs, for example by discouraging |
Good idea! I will review the |
We're writing a binding to try to wire ureq and Arti (Tor Client) together.
Right now, if the connection across the Tor network fails, the ureq API seems to wants us to throw
ureq::Error::ConnectionFailed
. The result will be that the ultimate user sees almost no information about the error.It's probably too late to improve
ConnectionFailed
, but maybe a different variant shoudl be provided that would allow us to transport our own error somehow (boxed, presumably). Or should we be converting everything toureq::Error::Io
? Because that contains anio::Error
, we could make use ofstd::Io::Error
's escape hatch...The text was updated successfully, but these errors were encountered: