github.com/turtlemonvh/terraform@v0.6.9-0.20151204001754-8e40b6b855e8/builtin/providers/azure/utils_test.go (about) 1 package azure 2 3 import ( 4 "fmt" 5 6 "github.com/Azure/azure-sdk-for-go/management" 7 ) 8 9 // testAccResourceDestroyedErrorFilter tests whether the given error is an azure ResourceNotFound 10 // error and properly annotates it if otherwise: 11 func testAccResourceDestroyedErrorFilter(resource string, err error) error { 12 switch { 13 case err == nil: 14 return fmt.Errorf("Azure %s still exists.", resource) 15 case err != nil && management.IsResourceNotFoundError(err): 16 return nil 17 default: 18 return err 19 } 20 }