Skip to content

Commit

Permalink
Charmhub: Add better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonRichardson committed May 25, 2021
1 parent 55084c5 commit 11b3e3d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charmhub/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,5 @@ func (c *DownloadClient) downloadFromURL(ctx context.Context, resourceURL *url.U

// Server error, nothing we can do other than inform the user that the
// archive was unaviable.
return nil, errors.Errorf("unable to locate archive with status: %s", resp.Status)
return nil, errors.Errorf("unable to locate archive (store API responded with status: %s)", resp.Status)
}
2 changes: 1 addition & 1 deletion charmhub/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (s *DownloadSuite) TestDownloadAndReadWithFailedStatusCode(c *gc.C) {

client := NewDownloadClient(transport, fileSystem, &FakeLogger{})
_, err = client.DownloadAndRead(context.TODO(), serverURL, tmpFile.Name())
c.Assert(err, gc.ErrorMatches, `cannot retrieve "http://meshuggah.rocks": unable to locate archive with status: Internal Server Error`)
c.Assert(err, gc.ErrorMatches, `cannot retrieve "http://meshuggah.rocks": unable to locate archive \(store API responded with status: Internal Server Error\)`)
}

func (s *DownloadSuite) createCharmArchieve(c *gc.C) []byte {
Expand Down

0 comments on commit 11b3e3d

Please sign in to comment.