erasure: waitCloser should implement CloseWithError. (#1543)

This is needed so that the other end of the pipe receives
and error, cleanups temporary files.
This commit is contained in:
Harshavardhana
2016-05-08 16:26:10 -07:00
parent a8fdd04e62
commit 90ea494338
2 changed files with 12 additions and 2 deletions

View File

@@ -144,9 +144,9 @@ func safeCloseAndRemove(writer io.WriteCloser) error {
if ok {
return safeWriter.CloseAndRemove()
}
pipeWriter, ok := writer.(*io.PipeWriter)
wCloser, ok := writer.(*waitCloser)
if ok {
return pipeWriter.CloseWithError(errors.New("Close and error out."))
return wCloser.CloseWithError(errors.New("Close and error out."))
}
return nil
}