From 654bb9cfeb02d8539eb45c9c8fc67e1b5d9eb406 Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Fri, 13 Nov 2020 13:12:36 -0500 Subject: [PATCH] GCLOUD: Don't panic() on unknown domain name (#944) * GCLOUD: Dont panic on unknown domains --- providers/gcloud/gcloudProvider.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/providers/gcloud/gcloudProvider.go b/providers/gcloud/gcloudProvider.go index c5a3ccf47..682d5807d 100644 --- a/providers/gcloud/gcloudProvider.go +++ b/providers/gcloud/gcloudProvider.go @@ -125,8 +125,9 @@ func (g *gcloudProvider) GetNameservers(domain string) ([]*models.Nameserver, er if err != nil { return nil, err } - //fmt.Printf("zone = %q\n", zone) - //fmt.Printf("zone.NameServers = %q\n", zone.NameServers) + if zone == nil { + return nil, fmt.Errorf("Domain %q not found in your GCLOUD account", domain) + } return models.ToNameserversStripTD(zone.NameServers) }