diff --git a/lib/modules/ens/embarkjs.js b/lib/modules/ens/embarkjs.js index 6663f023a..f3dabedbe 100644 --- a/lib/modules/ens/embarkjs.js +++ b/lib/modules/ens/embarkjs.js @@ -252,7 +252,12 @@ __embarkENS.registerSubDomain = function (name, address, callback) { // Register function generated by the index registerSubDomain(this.ens, this.registrar, this.resolver, web3.eth.defaultAccount, name, this.registration.rootDomain, - web3.utils.soliditySha3(address.toLowerCase().substr(2) + reverseAddrSuffix), address, console, EmbarkJS.Utils.secureSend, callback); + web3.utils.soliditySha3(address.toLowerCase().substr(2) + reverseAddrSuffix), address, console, EmbarkJS.Utils.secureSend, (err, result) => { + if (err && err.indexOf('Transaction has been reverted by the EVM') > -1) { + return callback('Registration was rejected. Are you the owner of the root domain?'); + } + callback(err, result); + }); }; __embarkENS.isAvailable = function () { diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index 0d249dc9d..70c1286a4 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -323,8 +323,10 @@ class ENS { next(); }) .catch(err => { - console.error('Error while registering the root domain'); - console.error(err); + self.logger.error('Error while registering the root domain'); + if (err.message.indexOf('Transaction has been reverted by the EVM') > -1) { + return next(__('Registration was rejected. Did you change the deployment account? If so, delete chains.json')); + } next(err); }); });