diff --git a/fivetran/resource_external_logging_test.go b/fivetran/resource_external_logging_test.go index 2222ffa9..93a52e6d 100644 --- a/fivetran/resource_external_logging_test.go +++ b/fivetran/resource_external_logging_test.go @@ -112,10 +112,10 @@ func testFivetranExternalLoggingResourceDestroy(s *terraform.State) error { } response, err := client.NewExternalLoggingDetails().ExternalLoggingId(rs.Primary.ID).Do(context.Background()) - if err.Error() != "status code: 404; expected: 200" { - return err - } - if response.Code != "NotFound" { + if !strings.HasPrefix(err.Error(), "status code: 404; expected: 200") { + return err + } + if !strings.HasPrefix(response.Code, "NotFound") { return errors.New("External Logging " + rs.Primary.ID + " still exists. Response code: " + response.Code) }