From 0e486282a0a963c5ce102f07c5622af100316757 Mon Sep 17 00:00:00 2001 From: Jarmo Isotalo Date: Thu, 8 Dec 2016 14:59:31 +0200 Subject: [PATCH] Fix unhandled promise rejection (#162) --- lib/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 663e03e..8527da9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -404,7 +404,7 @@ export default class Now extends EventEmitter { } getNameservers(domain) { - return new Promise(resolve => { + return new Promise((resolve, reject) => { let fallback = false this.retry(async (bail, attempt) => { @@ -445,6 +445,8 @@ export default class Now extends EventEmitter { return ns.length }) resolve(body) + }).catch(err => { + reject(err) }) }) }