Skip to content

Commit bebd669

Browse files
committedApr 29, 2022
Better error coalescing for OpenEthereum nodes (#2846).

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎packages/providers/src.ts/json-rpc-provider.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,28 +77,28 @@ function checkError(method: string, error: any, params: any): any {
7777
const transaction = params.transaction || params.signedTransaction;
7878

7979
// "insufficient funds for gas * price + value + cost(data)"
80-
if (message.match(/insufficient funds|base fee exceeds gas limit/)) {
80+
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
8181
logger.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
8282
error, method, transaction
8383
});
8484
}
8585

8686
// "nonce too low"
87-
if (message.match(/nonce (is )?too low/)) {
87+
if (message.match(/nonce (is )?too low/i)) {
8888
logger.throwError("nonce has already been used", Logger.errors.NONCE_EXPIRED, {
8989
error, method, transaction
9090
});
9191
}
9292

9393
// "replacement transaction underpriced"
94-
if (message.match(/replacement transaction underpriced/)) {
94+
if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
9595
logger.throwError("replacement fee too low", Logger.errors.REPLACEMENT_UNDERPRICED, {
9696
error, method, transaction
9797
});
9898
}
9999

100100
// "replacement transaction underpriced"
101-
if (message.match(/only replay-protected/)) {
101+
if (message.match(/only replay-protected/i)) {
102102
logger.throwError("legacy pre-eip-155 transactions not supported", Logger.errors.UNSUPPORTED_OPERATION, {
103103
error, method, transaction
104104
});

0 commit comments

Comments
 (0)
Please sign in to comment.