diff --git a/mb-xrpl/lib/governance-manager.js b/mb-xrpl/lib/governance-manager.js index 6c06585..1eae51a 100644 --- a/mb-xrpl/lib/governance-manager.js +++ b/mb-xrpl/lib/governance-manager.js @@ -50,11 +50,7 @@ class GovernanceManager { try { await hostClient.connect(); candidateId = await hostClient.propose(hashes, shortName).catch(e => { - let err; - if (e.code === "tecHOOK_REJECTED" && e.hookExecutionResult) { - err = e.hookExecutionResult.map(o => o.message).join(', '); - } - throw err || e.code || 'PROPOSE_TX_ERR'; + throw (typeof e == 'object' ? (e.code || 'PROPOSE_TX_ERR') : e); }); } finally { await hostClient.disconnect(); @@ -75,11 +71,7 @@ class GovernanceManager { throw `Trying to remove governance candidate which is not owned by host.`; await hostClient.withdraw(candidateId).catch(e => { - let err; - if (e.code === "tecHOOK_REJECTED" && e.hookExecutionResult) { - err = e.hookExecutionResult.map(o => o.message).join(', '); - } - throw err || e.code || 'WITHDRAW_TX_ERR'; + throw (typeof e == 'object' ? (e.code || 'WITHDRAW_TX_ERR') : e); }); } finally { await hostClient.disconnect();