Skip to content

Commit 5ef6e79

Browse files
allow skipping errors while creating snowball archive
1 parent c0ea248 commit 5ef6e79

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

api-putobject-snowball.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ type SnowballOptions struct {
4848
// Compression will typically reduce memory and network usage,
4949
// Compression can safely be enabled with MinIO hosts.
5050
Compress bool
51+
52+
// SkipErrs if enabled will skip any errors while reading the
53+
// object content while creating the snowball archive
54+
SkipErrs bool
5155
}
5256

5357
// SnowballObject contains information about a single object to be added to the snowball.
@@ -184,10 +188,16 @@ objectLoop:
184188
n, err := io.Copy(t, obj.Content)
185189
if err != nil {
186190
closeObj()
191+
if opts.SkipErrs {
192+
continue
193+
}
187194
return err
188195
}
189196
if n != obj.Size {
190197
closeObj()
198+
if opts.SkipErrs {
199+
continue
200+
}
191201
return io.ErrUnexpectedEOF
192202
}
193203
closeObj()

0 commit comments

Comments
 (0)