Skip to content

Commit 7f9e316

Browse files
committed
restore returning ErrClosed
1 parent d86e550 commit 7f9e316

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

backends/s3/stream.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package s3
22

33
import (
44
"context"
5+
"errors"
56
"io"
67

8+
"github.com/PowerDNS/simpleblob"
79
"github.com/minio/minio-go/v7"
810
)
911

@@ -86,7 +88,7 @@ type writerWrapper struct {
8688

8789
func (w *writerWrapper) Write(p []byte) (n int, err error) {
8890
if w.closed {
89-
return 0, w.prevErr
91+
return 0, errors.Join(w.prevErr, simpleblob.ErrClosed)
9092
}
9193
if err := context.Cause(w.ctx); err != nil {
9294
_ = w.Close()
@@ -99,7 +101,7 @@ func (w *writerWrapper) Write(p []byte) (n int, err error) {
99101

100102
func (w *writerWrapper) Close() error {
101103
if w.closed {
102-
return w.prevErr
104+
return errors.Join(w.prevErr, simpleblob.ErrClosed)
103105
}
104106
w.closed = true
105107
w.prevErr = context.Cause(w.ctx)

0 commit comments

Comments
 (0)