diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index 01492f697..1b32c4a50 100644 --- a/lib/modules/ens/index.js +++ b/lib/modules/ens/index.js @@ -126,15 +126,12 @@ class ENS { }); }, function setContent(resolver, defaultAccount, next) { - resolver.methods.setContent(hashedName, contentHash).send({from: defaultAccount}).then((err, transaction) => { - if (err) { - return next(err); - } + resolver.methods.setContent(hashedName, contentHash).send({from: defaultAccount}).then((transaction) => { if (transaction.status !== "0x1" && transaction.status !== "0x01" && transaction.status !== true) { - return next('Association failed. Status: ' + transaction.status); + return next(new Error('Association failed. Status: ' + transaction.status)); } next(); - }); + }).catch(next); } ], cb); }