asyncreader: make ErrorStreamAbandoned public

This commit is contained in:
Nick Craig-Wood 2020-04-04 12:21:20 +01:00
parent 07908f3f54
commit 49e5299a95
2 changed files with 5 additions and 4 deletions

View file

@ -21,7 +21,8 @@ const (
bufferCacheFlushTime = 5 * time.Second // flush the cached buffers after this long
)
var errorStreamAbandoned = errors.New("stream abandoned")
// ErrorStreamAbandoned is returned when the input is closed before the end of the stream
var ErrorStreamAbandoned = errors.New("stream abandoned")
// AsyncReader will do async read-ahead from the input reader
// and make the data available as an io.Reader.
@ -132,7 +133,7 @@ func (a *AsyncReader) fill() (err error) {
if !ok {
// Return an error to show fill failed
if a.err == nil {
return errorStreamAbandoned
return ErrorStreamAbandoned
}
return a.err
}