Skip to content

Commit

Permalink
Improve error output when failing initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgHaj committed Oct 4, 2023
1 parent 323ed16 commit 849d9a5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/upload/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,18 +226,20 @@ func (uploadBatch *uploadBatch) initUpload() ([]string, error) {
return files, nil
}

var entryFile string
var err error
for len(files) > 0 {
entryFile := files[0]
entryFile = files[0]
files = files[1:]
err := uploadBatch.uploadFile(entryFile)
err = uploadBatch.uploadFile(entryFile)
if err == nil {
printSuccessfulUpload(entryFile)

return files, nil
}
}

return files, errors.New("failed to initialize a scan due to badly formatted files")
return files, errors.New("failed to initialize a scan due to badly formatted files.\nLatest tried file:" + entryFile + "\nError: " + err.Error())
}

type uploadedFile struct {
Expand Down

0 comments on commit 849d9a5

Please sign in to comment.