add helpful messages when ens register is rejected
This commit is contained in:
parent
623bdc50ae
commit
6b4321874b
|
@ -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 () {
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue