gateway-gcs: Close the writer with error in case of any errors. (#5217)

fixes #5216
This commit is contained in:
Krishna Srinivas 2017-11-21 14:45:37 -08:00 committed by Dee Koder
parent 4393afb7e2
commit bbd05a8f1c

View File

@ -805,7 +805,7 @@ func (l *gcsGateway) PutObject(bucket string, key string, data *hash.Reader, met
if _, err := io.Copy(w, data); err != nil {
// Close the object writer upon error.
w.Close()
w.CloseWithError(err)
return ObjectInfo{}, gcsToObjectError(traceError(err), bucket, key)
}