Skip to content

Commit

Permalink
Merge pull request #25 from eosnetworkfoundation/feature/propagate-er…
Browse files Browse the repository at this point in the history
…rors

catch errors from nodes and propagate to caller
  • Loading branch information
yarkinwho authored Aug 29, 2023
2 parents b2afdf5 + dc2b361 commit dcc5d5c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/miner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,16 @@ export default class EosEvmMiner {
).then(x => {
logger.info(`Pushed tx to ${this.config.rpcEndpoints[this.currentRpcEndpoint]}`);
logger.info(x);

return true;
}).catch(e => {
logger.error(`Error pushing #${this.pushCount} to ${this.config.rpcEndpoints[this.currentRpcEndpoint]}`);
logger.error(e);

// Too many possible reasons for this to fail,
// not necessarily an issue with the node.
// this.swapRpcEndpoint();

throw new Error("There was an error pushing this transaction from this EOS EVM miner.");
throw new Error(
"There was an error pushing this transaction from this EOS EVM miner: "
+ e.hasOwnProperty("details") ? e.details[0].message : e.hasOwnProperty("json") ? e.json.error.details[0].message : JSON.stringify(e)
);
});

logger.info(`Latency for #${this.pushCount}: ${Date.now() - timeStarted}ms`);
Expand Down

0 comments on commit dcc5d5c

Please sign in to comment.