fix: handle non-Error wallet rejections in error UI and Sentry filters#2931
fix: handle non-Error wallet rejections in error UI and Sentry filters#2931
Conversation
GasEstimationError crashed when rawError wasn't a standard Error object, sending a TypeError to Sentry on every wallet rejection. This was the main source of Sentry noise, not the filtered patterns. - Fix GasEstimationError to safely access rawError.message - Show wallet rejections as info, not error - Fix getErrorTextFromError to handle non-Error catch values - Fix reject() passing undefined to outer catch in useTransactionHandler - Combine Sentry event type + value in filter so patterns match class names
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 763e3f7f12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! Sixteen Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. |
reject(error) bypassed the null guard, causing double error handling.
|
📦 Next.js Bundle Analysis for aave-uiThis analysis was generated by the Next.js Bundle Analysis action. 🤖 🎉 Global Bundle Size Decreased
DetailsThe global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster. Any third party scripts you have added directly to your app using the If you want further insight into what is behind the changes, give @next/bundle-analyzer a try! Sixteen Pages Changed SizeThe following pages changed size from the code in this PR compared to its base branch:
DetailsOnly the gzipped size is provided here based on an expert tip. First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If Any third party scripts you have added directly to your app using the Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. |
Summary
rawErrorwasn't a standard Error object (e.g. wallet rejection objects from ethers/viem), causingTypeError: Cannot read properties of undefined (reading 'message')to be sent to Sentry on every wallet rejection. This was the main source of Sentry noise.getErrorTextFromErrornow safely handles non-Error catch valuesreject()in useTransactionHandler passingundefinedto the outer catch, which overwrote the correctly parsed rejection with a generic errortype+valueso patterns can match error class names (e.g.UserRejectedRequestError)Test plan
setTimeout(() => { throw new Error("User rejected the request") }, 0))