From 29066338d8166e6c968b180ed29ecc247dccaa45 Mon Sep 17 00:00:00 2001 From: Olli Vanhoja Date: Mon, 9 Jan 2017 10:07:43 +0200 Subject: [PATCH] Fix now alias on new domains (#207) Bail if no records are found for a domain to allow adding the records. now alias derp domain.com -d > [debug] Checking for updates. > [debug] Up to date (1.0.0). > [debug] /list: 583.880ms > [debug] matched deployment derp by url derp.now.sh > domain.com is a custom domain. > Verifying the DNS settings for domain.com (see https://zeit.world for help) > [debug] #1 GET /domains/domain.com: 271.741ms > [debug] Found domain domain.com with verified:true > [debug] No records found for "domain.com" > Verification OK! --- lib/alias.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/alias.js b/lib/alias.js index abe4c49..76944f0 100644 --- a/lib/alias.js +++ b/lib/alias.js @@ -413,9 +413,12 @@ export default class Alias extends Now { if (this._debug) { console.log(`> [debug] No records found for "${domain}"`) } - } else { - throw err + + const err = new Error(DOMAIN_VERIFICATION_ERROR) + err.userError = true + return bail(err) } + throw err } if (ips.length <= 0) {