You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already have a Stream.ShutdownWithErr mechanism, which propagates a custom error.
There's also a Stream.Cancel method. However, there should be a Stream.CancelWithErr method to allow propagation of a custom error.
For example, let's say I'm reading from an http response, and writing the bytes to a stream. If there's an error reading the response, I specifically want to Cancel the stream (as opposed to calling Shutdown). But, any clients of the stream will just receive a generic ErrCanceled, which is not super helpful. I want to be able to propagate the http error back to the stream clients.
I agree the with concept, I haven't had time to review the implementation though.
Work/life have been really busy with the holiday season, I'll take a look when I can though, thanks!
We already have a
Stream.ShutdownWithErr
mechanism, which propagates a custom error.There's also a
Stream.Cancel
method. However, there should be aStream.CancelWithErr
method to allow propagation of a custom error.For example, let's say I'm reading from an http response, and writing the bytes to a stream. If there's an error reading the response, I specifically want to
Cancel
the stream (as opposed to callingShutdown
). But, any clients of the stream will just receive a genericErrCanceled
, which is not super helpful. I want to be able to propagate the http error back to the stream clients.Possible implementation in PR #11.
The text was updated successfully, but these errors were encountered: