From 09ae33354b0958ecbfdb43e6b373f46e142b107f Mon Sep 17 00:00:00 2001 From: Hakkin Lain Date: Fri, 8 Nov 2019 11:12:05 -0800 Subject: [PATCH] Update error checking. --- stream.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/stream.go b/stream.go index 3e23523..6e6460d 100644 --- a/stream.go +++ b/stream.go @@ -27,16 +27,10 @@ func streamTs(c *http.Client, ts <-chan string, out io.Writer, done chan<- error } _, err = io.Copy(&writerError{out}, &readerError{res.Body}) - if err != nil { - if errors.Is(err, io.EOF) { - return nil - } + if err != nil && !errors.Is(err, io.EOF) { if wErr, ok := err.(*writeError); ok { return &fatalError{fmt.Errorf("error while writing ts to output: %w", wErr.Unwrap())} } - if errors.Is(err, io.ErrUnexpectedEOF) { - return &skipError{fmt.Errorf("got unexpected EOF while copying ts to output")} - } return &skipError{fmt.Errorf("couldn't copy ts to output: %w", err)} }