diff --git a/internal/upload/batch.go b/internal/upload/batch.go index 89691835..3408dabf 100644 --- a/internal/upload/batch.go +++ b/internal/upload/batch.go @@ -226,10 +226,12 @@ 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) @@ -237,7 +239,7 @@ func (uploadBatch *uploadBatch) initUpload() ([]string, error) { } } - 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 {