diff --git a/lib/modules/ens/embarkjs.js b/lib/modules/ens/embarkjs.js index 6579b2d07..6631f9fd2 100644 --- a/lib/modules/ens/embarkjs.js +++ b/lib/modules/ens/embarkjs.js @@ -14,6 +14,7 @@ __embarkENS.resolverInterface = [ } ], "name": "addr", + "outputs": [ { "name": "", @@ -195,7 +196,14 @@ __embarkENS.resolve = function (name) { return resolverContract.methods.addr(node).call(); }).then((addr) => { return addr; - }).catch(err => err); + }).catch((err) => { + if (err == 'Couldn\'t decode addr from ABI: 0x') { + console.log(name + " is not registered"); + return "0x"; + } else { + return err; + } + }); }; __embarkENS.lookup = function (address) { @@ -212,5 +220,12 @@ __embarkENS.lookup = function (address) { return self.ens.methods.resolver(node).call().then((resolverAddress) => { let resolverContract = new EmbarkJS.Contract({abi: self.resolverInterface, address: resolverAddress}); return resolverContract.methods.name(node).call(); - }).catch(err => err); + }).catch((err) => { + if (err == 'ERROR: The returned value is not a convertible string: 0x0') { + console.log('Address does not resolve to name. Try syncing chain.'); + return ""; + } else { + return err; + } + }); };