Skip to content

Commit

Permalink
updated the errors
Browse files Browse the repository at this point in the history
  • Loading branch information
simsonraj committed Jun 13, 2024
1 parent 8941aeb commit 21b25bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/chains/evm/client/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ func (e *ClientErrors) ErrIs(err error, errorTypes ...int) bool {
if err == nil {
return false
}

cause := pkgerrors.Cause(err).Error()
for _, errorType := range errorTypes {
if _, ok := (*e)[errorType]; !ok {
return false
}
if (*e)[errorType].String() == "" {
return false
}
if (*e)[errorType].MatchString(pkgerrors.Cause(err).Error()) {
if (*e)[errorType].MatchString(cause) {
return true
}
}
Expand Down Expand Up @@ -253,7 +255,7 @@ var hederaFatal = regexp.MustCompile(`(: |^)(execution reverted)(:|$) | ^Transac
var hedera = ClientErrors{
NonceTooLow: regexp.MustCompile(`Nonce too low`),
NonceTooHigh: regexp.MustCompile(`Nonce too high`),
TerminallyUnderpriced: regexp.MustCompile(`Gas price '(\d+)' is below configured minimum gas price '(\d+)'`),
TerminallyUnderpriced: regexp.MustCompile(`(Gas price '(\d+)' is below configured minimum gas price '(\d+)')|(Gas price too low)`),
InsufficientEth: regexp.MustCompile(`Insufficient funds for transfer| failed precheck with status INSUFFICIENT_PAYER_BALANCE`),
Fatal: hederaFatal,
}
Expand Down

0 comments on commit 21b25bb

Please sign in to comment.