Description
As discussed in #1128, there is good reason to consider having 2 different error types, and they would be useful for the Client
as well. The hyper::Error
is the correct error type for the Client
to return from its Future
, as well as from the response's body stream.
However, It does not makes sense for the request body stream to require sending a hyper::Error
if generating the body failed. In that case, nothing in hyper failed, and the only relevant thing to hyper is that the stream cannot be completed. So the error type sent should be some sort of Disconnect
or Abort
or whatever, since an error on the body stream means the only thing hyper can reasonably do is to give up on the connection.
As in the server issue, the From<std::io::Error>
and From<hyper::Error>
implementations would be useful to allow easily sending streams from other sources, but it would be clear that the actual error type means "kill it dead."
New proposal: #1431