Skip to content

Commit 9f990c5

Browse files
committed
Added new error strings Pocket returns.
1 parent 74e3d98 commit 9f990c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function checkError(method: string, error: any, params: any): any {
9494
message = (message || "").toLowerCase();
9595

9696
// "insufficient funds for gas * price + value + cost(data)"
97-
if (message.match(/insufficient funds|base fee exceeds gas limit/i)) {
97+
if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
9898
logger.throwError("insufficient funds for intrinsic transaction cost", Logger.errors.INSUFFICIENT_FUNDS, {
9999
error, method, transaction
100100
});
@@ -121,7 +121,7 @@ function checkError(method: string, error: any, params: any): any {
121121
});
122122
}
123123

124-
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted/)) {
124+
if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
125125
logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
126126
error, method, transaction
127127
});

0 commit comments

Comments
 (0)