Skip to content

Commit

Permalink
Make DownloadBlobs return a multierror
Browse files Browse the repository at this point in the history
[#132622945]
Signed-off-by: Dennis Leon <[email protected]>

Signed-off-by: Zachary Auerbach <[email protected]>
  • Loading branch information
DennisDenuto authored and zaksoup committed Oct 17, 2016
1 parent 22aeb1d commit 463c686
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion releasedir/fs_blobs_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (d FSBlobsDir) DownloadBlobs(numOfParallelWorkers int) error {
}

if errs != nil {
return bosherr.Errorf("Downloading blobs failed due to the following errors: %v", errs)
return bosherr.NewMultiError(errs...)
}

return nil
Expand Down
5 changes: 3 additions & 2 deletions releasedir/fs_blobs_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ already-downloaded.tgz:

err := act(1)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Downloading blobs failed due to the following errors: [Getting blob 'blob1' for path 'dir/file-in-directory.tgz': fake-err]"))
Expect(err.Error()).To(ContainSubstring("Getting blob 'blob1' for path 'dir/file-in-directory.tgz': fake-err"))

Expect(reporter.BlobDownloadStartedCallCount()).To(Equal(2))
Expect(reporter.BlobDownloadFinishedCallCount()).To(Equal(2))
Expand All @@ -213,7 +213,8 @@ already-downloaded.tgz:

err := act(1)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("Downloading blobs failed due to the following errors: [Getting blob 'blob1' for path 'dir/file-in-directory.tgz': fake-err1 Getting blob 'blob2' for path 'file-in-root.tgz': fake-err2]"))
Expect(err.Error()).To(ContainSubstring("Getting blob 'blob1' for path 'dir/file-in-directory.tgz': fake-err1"))
Expect(err.Error()).To(ContainSubstring("Getting blob 'blob2' for path 'file-in-root.tgz': fake-err2"))

Expect(fs.FileExists("/dir/blobs/dir")).To(BeFalse())
Expect(fs.FileExists("/dir/blobs/dir/file-in-directory.tgz")).To(BeFalse())
Expand Down

0 comments on commit 463c686

Please sign in to comment.