fix(wallet)_: fixed some errors handling that caused provider up/down

banner
This commit is contained in:
Ivan Belyakov 2024-07-04 17:01:42 +02:00 committed by IvanBelyakoff
parent d977914f6b
commit 23b185ae2b
2 changed files with 2 additions and 6 deletions

View File

@ -197,17 +197,13 @@ func (c *ClientWithFallback) Close() {
} }
func isVMError(err error) bool { func isVMError(err error) bool {
if strings.HasPrefix(err.Error(), "execution reverted") {
return true
}
if strings.Contains(err.Error(), core.ErrInsufficientFunds.Error()) { if strings.Contains(err.Error(), core.ErrInsufficientFunds.Error()) {
return true return true
} }
for _, vmError := range propagateErrors { for _, vmError := range propagateErrors {
if err == vmError { if strings.Contains(err.Error(), vmError.Error()) {
return true return true
} }
} }
return false return false
} }

View File

@ -584,7 +584,7 @@ func (o *Manager) fetchTokenURI(ctx context.Context, id thirdparty.CollectibleUn
if err != nil { if err != nil {
for _, errorPrefix := range noTokenURIErrorPrefixes { for _, errorPrefix := range noTokenURIErrorPrefixes {
if strings.HasPrefix(err.Error(), errorPrefix) { if strings.Contains(err.Error(), errorPrefix) {
// Contract doesn't support "TokenURI" method // Contract doesn't support "TokenURI" method
return "", nil return "", nil
} }