Change fmt error to errwrap wrapf

This commit is contained in:
Craig Knott 2017-04-27 11:39:10 -05:00
parent aa2e02ab14
commit 7781baa24b
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/efs"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraform/helper/schema"
)
@ -50,7 +51,7 @@ func dataSourceAwsEfsFileSystemRead(d *schema.ResourceData, meta interface{}) er
describeResp, err := efsconn.DescribeFileSystems(describeEfsOpts)
if err != nil {
return fmt.Errorf("Error retrieving EFS: {{err}}", err)
return errwrap.Wrapf("Error retrieving EFS: {{err}}", err)
}
if len(describeResp.FileSystems) != 1 {
return fmt.Errorf("Search returned %d results, please revise so only one is returned", len(describeResp.FileSystems))