diff --git a/docs/storage/driver/swift/swift.go b/docs/storage/driver/swift/swift.go index 9287be41..2620de00 100644 --- a/docs/storage/driver/swift/swift.go +++ b/docs/storage/driver/swift/swift.go @@ -343,7 +343,9 @@ func (d *driver) WriteStream(ctx context.Context, path string, offset int64, rea if err != nil { return bytesRead, parseError(path, err) } - io.Copy(currentSegment, file) + if _, err := io.Copy(currentSegment, file); err != nil { + return bytesRead, parseError(path, err) + } file.Close() } if n > 0 {