Adds bucket name to bucket not found error message

pull/33851/head
Graham Davison 3 years ago
parent a560730376
commit 942d72b3e5

@ -45,7 +45,7 @@ func (b *Backend) Workspaces() ([]string, error) {
page, err := pages.NextPage(ctx)
if err != nil {
if IsA[*s3types.NoSuchBucket](err) {
return nil, fmt.Errorf(errS3NoSuchBucket, err)
return nil, fmt.Errorf(errS3NoSuchBucket, b.bucketName, err)
}
return nil, err
}

@ -120,7 +120,7 @@ func (c *RemoteClient) get(ctx context.Context) (*remote.Payload, error) {
if err != nil {
switch {
case IsA[*s3types.NoSuchBucket](err):
return nil, fmt.Errorf(errS3NoSuchBucket, err)
return nil, fmt.Errorf(errS3NoSuchBucket, c.bucketName, err)
case IsA[*s3types.NotFound](err):
return nil, nil
}
@ -147,7 +147,7 @@ func (c *RemoteClient) get(ctx context.Context) (*remote.Payload, error) {
if err != nil {
switch {
case IsA[*s3types.NoSuchBucket](err):
return nil, fmt.Errorf(errS3NoSuchBucket, err)
return nil, fmt.Errorf(errS3NoSuchBucket, c.bucketName, err)
case IsA[*s3types.NoSuchKey](err):
return nil, nil
}
@ -459,7 +459,7 @@ to manually verify the remote state and update the Digest value stored in the
DynamoDB table to the following value: %x
`
const errS3NoSuchBucket = `S3 bucket does not exist.
const errS3NoSuchBucket = `S3 bucket %q does not exist.
The referenced S3 bucket must have been previously created. If the S3 bucket
was created within the last minute, please wait for a minute or two and try

Loading…
Cancel
Save