Skip to content

Commit

Permalink
Improve error message when scanning through the tar file (#2278)
Browse files Browse the repository at this point in the history
* improve error message when scanning through the tar file

* Improve error message

Co-authored-by: Shubhendu <shubhendu.tripathi@gmail.com>

---------

Co-authored-by: Shubhendu <shubhendu.tripathi@gmail.com>
  • Loading branch information
ramondeklein and shtripat committed Aug 16, 2024
1 parent 3eef3a2 commit 97d95fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/apis/minio.min.io/v2/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ func ExtractTar(filesToExtract []string, basePath, tarFileName string) error {
}

if err != nil {
if errors.Is(err, io.EOF) {
return fmt.Errorf("Tar file contains only %d out of %d files", len(filesToExtract)-success, len(filesToExtract))
}
return fmt.Errorf("Tar file extraction failed for file index: %d, with: %w", success, err)
}
if header.Typeflag == tar.TypeReg {
Expand Down

0 comments on commit 97d95fa

Please sign in to comment.