diff --git a/HISTORY.md b/HISTORY.md index f7792bb..3fc58f4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,4 +1,16 @@ +0.21.0 / 2016-08-16 +================== + + * fix exceptions + * domain add: try fallback if the list of name servers is empty [@hbp] + * show a proper error message for protected domain names [@hbp] + +0.20.0 / 2016-08-16 +================== + + * docker support + 0.19.0 / 2016-07-22 =================== diff --git a/lib/alias.js b/lib/alias.js index cedfdc1..ae9543d 100644 --- a/lib/alias.js +++ b/lib/alias.js @@ -200,6 +200,12 @@ export default class Alias extends Now { return bail(err); } + if ('forbidden' === code) { + const err = new Error('The domain you are trying to use as an alias is already in use by a different account.'); + err.userError = true; + return bail(err); + } + return bail(new Error('Authorization error')); } diff --git a/lib/index.js b/lib/index.js index e834998..4bac1be 100644 --- a/lib/index.js +++ b/lib/index.js @@ -354,7 +354,7 @@ export default class Now extends EventEmitter { if (this._debug) console.timeEnd(`> [debug] #${attempt} GET /whois-ns${fallback ? '-fallback' : ''}`); const body = await res.json(); if (200 === res.status) { - if (!body.nameservers && !fallback) { + if ((!body.nameservers || body.nameservers.length === 0) && !fallback) { // if the nameservers are `null` it's likely // that our whois service failed to parse it return this.getNameservers(domain, { fallback: true }); diff --git a/package.json b/package.json index 6d999b5..ac0b13e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "now", - "version": "0.19.0", + "version": "0.21.0", "description": "realtime instant node.js deployment with one command", "readme": "", "main": "./build/lib/index", @@ -8,7 +8,10 @@ "build" ], "greenkeeper": { - "emails": false + "emails": false, + "ignore": [ + "babel-runtime" + ] }, "babel": { "presets": [ @@ -89,7 +92,7 @@ "babel-register": "6.11.6", "del": "2.2.2", "enclose": "2.2.0", - "eslint": "3.3.0", + "eslint": "3.3.1", "eslint-config-standard": "5.3.5", "eslint-plugin-promise": "2.0.1", "eslint-plugin-standard": "2.0.0",