Skip to content

Commit

Permalink
allow skipping errors while creating snowball archive
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana committed Aug 14, 2023
1 parent b42bd7d commit 7f0ec61
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api-putobject-snowball.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ type SnowballOptions struct {
// Compression will typically reduce memory and network usage,
// Compression can safely be enabled with MinIO hosts.
Compress bool

// SkipErrs if enabled will skip any errors while reading the
// object content while creating the snowball archive
SkipErrs bool
}

// SnowballObject contains information about a single object to be added to the snowball.
Expand Down Expand Up @@ -184,10 +188,16 @@ objectLoop:
n, err := io.Copy(t, obj.Content)
if err != nil {
closeObj()
if opts.SkipErrs {
continue
}
return err
}
if n != obj.Size {
closeObj()
if opts.SkipErrs {
continue
}
return io.ErrUnexpectedEOF
}
closeObj()
Expand Down

0 comments on commit 7f0ec61

Please sign in to comment.