Skip to content

Commit

Permalink
Added new error strings Pocket returns.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Oct 19, 2022
1 parent 74e3d98 commit 9f990c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/providers/src.ts/json-rpc-provider.ts
Expand Up @@ -94,7 +94,7 @@ function checkError(method: string, error: any, params: any): any {
message = (message || "").toLowerCase();

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

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

0 comments on commit 9f990c5

Please sign in to comment.