From f99f9bf3b2407f71510fb06eb823ef1baa95e966 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Fri, 7 Feb 2020 08:37:35 -0800 Subject: [PATCH] change error wrap formatting (#3089) --- .../terraform/resources/resource_google_project.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/third_party/terraform/resources/resource_google_project.go b/third_party/terraform/resources/resource_google_project.go index c14b70c10d4a..797d7fa46043 100644 --- a/third_party/terraform/resources/resource_google_project.go +++ b/third_party/terraform/resources/resource_google_project.go @@ -159,14 +159,14 @@ func resourceGoogleProjectCreate(d *schema.ResourceData, meta interface{}) error if !d.Get("auto_create_network").(bool) { // The compute API has to be enabled before we can delete a network. if err = enableServiceUsageProjectServices([]string{"compute.googleapis.com"}, project.ProjectId, config, d.Timeout(schema.TimeoutCreate)); err != nil { - return errwrap.Wrapf("Error enabling the Compute Engine API required to delete the default network: ", err) + return errwrap.Wrapf("Error enabling the Compute Engine API required to delete the default network: {{err}} ", err) } if err = forceDeleteComputeNetwork(d, config, project.ProjectId, "default"); err != nil { if isGoogleApiErrorWithCode(err, 404) { log.Printf("[DEBUG] Default network not found for project %q, no need to delete it", project.ProjectId) } else { - return errwrap.Wrapf(fmt.Sprintf("Error deleting default network in project %s: ", project.ProjectId), err) + return errwrap.Wrapf(fmt.Sprintf("Error deleting default network in project %s: {{err}}", project.ProjectId), err) } } } @@ -397,7 +397,7 @@ func forceDeleteComputeNetwork(d *schema.ResourceData, config *Config, projectId filter := fmt.Sprintf("network eq %s", networkLink) resp, err := config.clientCompute.Firewalls.List(projectId).Filter(filter).Do() if err != nil { - return errwrap.Wrapf("Error listing firewall rules in proj:", err) + return errwrap.Wrapf("Error listing firewall rules in proj: {{err}}", err) } log.Printf("[DEBUG] Found %d firewall rules in %q network", len(resp.Items), networkName) @@ -405,7 +405,7 @@ func forceDeleteComputeNetwork(d *schema.ResourceData, config *Config, projectId for _, firewall := range resp.Items { op, err := config.clientCompute.Firewalls.Delete(projectId, firewall.Name).Do() if err != nil { - return errwrap.Wrapf("Error deleting firewall: ", err) + return errwrap.Wrapf("Error deleting firewall: {{err}}", err) } err = computeOperationWait(config, op, projectId, "Deleting Firewall") if err != nil { @@ -456,7 +456,7 @@ func deleteComputeNetwork(project, network string, config *Config) error { op, err := config.clientCompute.Networks.Delete( project, network).Do() if err != nil { - return errwrap.Wrapf("Error deleting network: ", err) + return errwrap.Wrapf("Error deleting network: {{err}}", err) } err = computeOperationWaitTime(config, op, project, "Deleting Network", 10)