From 07b0af992b384ab2f1b2b449e6c0f9c6764814e2 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Tue, 24 Aug 2021 17:01:11 +0000 Subject: [PATCH] fixed error in ds (#5127) Signed-off-by: Modular Magician --- .changelog/5127.txt | 3 +++ google/data_source_dns_managed_zone.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 .changelog/5127.txt diff --git a/.changelog/5127.txt b/.changelog/5127.txt new file mode 100644 index 00000000000..7e5002cbf6e --- /dev/null +++ b/.changelog/5127.txt @@ -0,0 +1,3 @@ +```release-note:bug +Cloud DNS: fixed not-exists error message on data source `google_dns_managed_zone` +``` diff --git a/google/data_source_dns_managed_zone.go b/google/data_source_dns_managed_zone.go index 2beea291fc3..40426a68e36 100644 --- a/google/data_source_dns_managed_zone.go +++ b/google/data_source_dns_managed_zone.go @@ -66,7 +66,7 @@ func dataSourceDnsManagedZoneRead(d *schema.ResourceData, meta interface{}) erro zone, err := config.NewDnsClient(userAgent).ManagedZones.Get( project, name).Do() if err != nil { - return err + return handleNotFoundError(err, d, fmt.Sprintf("dataSourceDnsManagedZone %q", name)) } if err := d.Set("name_servers", zone.NameServers); err != nil {