Handle error during copy of original content

Signed-off-by: Sylvain Baubeau <sbaubeau@redhat.com>
pull/493/head
Sylvain Baubeau 2015-05-29 15:46:12 +02:00
parent 5f6a07756f
commit 5e650a820a
1 changed files with 3 additions and 1 deletions

View File

@ -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 {