diff --git a/src/core/runtime/dns-browser.js b/src/core/runtime/dns-browser.js index 26cf106ee0..adfe926886 100644 --- a/src/core/runtime/dns-browser.js +++ b/src/core/runtime/dns-browser.js @@ -10,11 +10,13 @@ module.exports = (domain, opts, callback) => { window.fetch(url, {mode: 'cors'}) .then((response) => { - const resp = response.json() - if (resp.Path) { - return callback(null, resp.Path) + return response.json() + }) + .then((response) => { + if (response.Path) { + return callback(null, response.Path) } else { - return callback(new Error(resp.Message)) + return callback(new Error(response.Message)) } }) .catch((error) => {