mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-06-29 06:42:36 +00:00
Avoid overwriting errors so that they can be detected by handleNotFoundError. (#2526)
This commit is contained in:
parent
5bc96d3fa1
commit
e74ccfde23
|
@ -2,6 +2,7 @@ package google
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/errwrap"
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
"google.golang.org/api/logging/v2"
|
||||
|
@ -58,7 +59,7 @@ func (u *BillingAccountLoggingExclusionUpdater) ReadLoggingExclusion(id string)
|
|||
exclusion, err := u.Config.clientLogging.BillingAccounts.Exclusions.Get(id).Do()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error retrieving logging exclusion for %s: %s", u.DescribeResource(), err)
|
||||
return nil, errwrap.Wrapf(fmt.Sprintf("Error retrieving logging exclusion for %s: {{err}}", u.DescribeResource()), err)
|
||||
}
|
||||
|
||||
return exclusion, nil
|
||||
|
|
|
@ -2,6 +2,7 @@ package google
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/errwrap"
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
"google.golang.org/api/logging/v2"
|
||||
|
@ -59,7 +60,7 @@ func (u *FolderLoggingExclusionUpdater) ReadLoggingExclusion(id string) (*loggin
|
|||
exclusion, err := u.Config.clientLogging.Folders.Exclusions.Get(id).Do()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error retrieving logging exclusion for %s: %s", u.DescribeResource(), err)
|
||||
return nil, errwrap.Wrapf(fmt.Sprintf("Error retrieving logging exclusion for %s: {{err}}", u.DescribeResource()), err)
|
||||
}
|
||||
|
||||
return exclusion, nil
|
||||
|
|
|
@ -2,6 +2,7 @@ package google
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/errwrap"
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
"google.golang.org/api/logging/v2"
|
||||
|
@ -58,7 +59,7 @@ func (u *OrganizationLoggingExclusionUpdater) ReadLoggingExclusion(id string) (*
|
|||
exclusion, err := u.Config.clientLogging.Organizations.Exclusions.Get(id).Do()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error retrieving logging exclusion for %s: %s", u.DescribeResource(), err)
|
||||
return nil, errwrap.Wrapf(fmt.Sprintf("Error retrieving logging exclusion for %s: {{err}}", u.DescribeResource()), err)
|
||||
}
|
||||
|
||||
return exclusion, nil
|
||||
|
|
|
@ -2,6 +2,7 @@ package google
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hashicorp/errwrap"
|
||||
"github.com/hashicorp/terraform/helper/schema"
|
||||
"google.golang.org/api/logging/v2"
|
||||
|
@ -65,7 +66,7 @@ func (u *ProjectLoggingExclusionUpdater) ReadLoggingExclusion(id string) (*loggi
|
|||
exclusion, err := u.Config.clientLogging.Projects.Exclusions.Get(id).Do()
|
||||
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error retrieving logging exclusion for %s: %s", u.DescribeResource(), err)
|
||||
return nil, errwrap.Wrapf(fmt.Sprintf("Error retrieving logging exclusion for %s: {{err}}", u.DescribeResource()), err)
|
||||
}
|
||||
|
||||
return exclusion, nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user