From ac91ffb9677ddae81ca1449ff7893a74b3493c5a Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 30 Jul 2018 13:38:12 -0400 Subject: [PATCH] fix using promise --- lib/modules/ens/index.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/modules/ens/index.js b/lib/modules/ens/index.js index 01492f69..1b32c4a5 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); }