Skip to content

Commit dcc5d5c

Browse files
authored
Merge pull request #25 from eosnetworkfoundation/feature/propagate-errors
catch errors from nodes and propagate to caller
2 parents b2afdf5 + dc2b361 commit dcc5d5c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/miner.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ export default class EosEvmMiner {
6666
).then(x => {
6767
logger.info(`Pushed tx to ${this.config.rpcEndpoints[this.currentRpcEndpoint]}`);
6868
logger.info(x);
69+
6970
return true;
7071
}).catch(e => {
7172
logger.error(`Error pushing #${this.pushCount} to ${this.config.rpcEndpoints[this.currentRpcEndpoint]}`);
7273
logger.error(e);
7374

74-
// Too many possible reasons for this to fail,
75-
// not necessarily an issue with the node.
76-
// this.swapRpcEndpoint();
77-
78-
throw new Error("There was an error pushing this transaction from this EOS EVM miner.");
75+
throw new Error(
76+
"There was an error pushing this transaction from this EOS EVM miner: "
77+
+ e.hasOwnProperty("details") ? e.details[0].message : e.hasOwnProperty("json") ? e.json.error.details[0].message : JSON.stringify(e)
78+
);
7979
});
8080

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

0 commit comments

Comments
 (0)