Signed-off-by: VoR0220 <catalanor0220@gmail.com>
This commit is contained in:
VoR0220 2018-06-26 14:56:23 -05:00 committed by Iuri Matias
parent 06953d99c4
commit 6477b688c1
1 changed files with 2 additions and 2 deletions

View File

@ -196,7 +196,7 @@ __embarkENS.resolve = function (name) {
}).then((addr) => { }).then((addr) => {
return addr; return addr;
}).catch((err) => { }).catch((err) => {
if (err == 'Error: Couldn\'t decode address from ABI: 0x') { if (err === NoDecodeAddrError) {
console.log(name + " is not registered"); console.log(name + " is not registered");
return "0x"; return "0x";
} }
@ -219,7 +219,7 @@ __embarkENS.lookup = function (address) {
let resolverContract = new EmbarkJS.Contract({abi: self.resolverInterface, address: resolverAddress}); let resolverContract = new EmbarkJS.Contract({abi: self.resolverInterface, address: resolverAddress});
return resolverContract.methods.name(node).call(); return resolverContract.methods.name(node).call();
}).catch((err) => { }).catch((err) => {
if (err == 'ERROR: The returned value is not a convertible string: 0x0' || err == 'Error: Couldn\'t decode address from ABI: 0x') { if (err === NoDecodeStringError || err === NoDecodeAddrError) {
console.log('Address does not resolve to name. Try syncing chain.'); console.log('Address does not resolve to name. Try syncing chain.');
return ""; return "";
} }