mirror of
https://github.com/EvernodeXRPL/sashimono.git
synced 2026-07-28 09:30:35 +00:00
Changes client errors in propose and withdraw (#239)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user