Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add not enough gas error to generic error #1150

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

agualis
Copy link
Contributor

@agualis agualis commented Oct 4, 2024

No description provided.

@agualis agualis self-assigned this Oct 4, 2024
Copy link

vercel bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 9:52am
test-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 9:52am

@@ -26,6 +26,11 @@ export function isTooManyRequestsError(error?: Error | null): boolean {
return error.message.startsWith('HTTP request failed.') && error.message.includes('Status: 429')
}

export function isNotEnoughGasError(error?: Error | null): boolean {
if (!error) return false
return error.message.startsWith('Execution reverted with reason: TRANSFER_FROM_FAILED.')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TRANSFER_FROM_FAILED could also have other causes so I will try to improve this later.
Saving the PR as draft for now

@agualis agualis marked this pull request as draft October 4, 2024 10:01
@agualis agualis removed the request for review from garethfuller October 4, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant