-
Notifications
You must be signed in to change notification settings - Fork 618
[TOOL-4986] Dashboard: Fix ERC20 asset page crash #7541
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
Conversation
|
|
""" WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant getContractCreator
participant Contract
Caller->>getContractCreator: call with contract, functionSelectors
getContractCreator->>getContractCreator: try
alt supports owner
getContractCreator->>Contract: await owner()
Contract-->>getContractCreator: return owner address
getContractCreator-->>Caller: return owner address
else supports admin role
getContractCreator->>Contract: await getRoleMember()
Contract-->>getContractCreator: return admin address
getContractCreator-->>Caller: return admin address
else
getContractCreator-->>Caller: return null
end
Note over getContractCreator: If any error occurs, catch and return null
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7541 +/- ##
=======================================
Coverage 51.87% 51.87%
=======================================
Files 954 954
Lines 64353 64353
Branches 4232 4232
=======================================
Hits 33382 33382
Misses 30863 30863
Partials 108 108
🚀 New features to boost your workflow:
|
size-limit report 📦
|
Merge activity
|
<!--
## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes"
If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000):
## Notes for the reviewer
Anything important to call out? Be sure to also clarify these in your comments.
## How to test
Unit tests, playground, etc.
-->
<!-- start pr-codex -->
---
## PR-Codex overview
This PR focuses on improving error handling by adding `try-catch` blocks around asynchronous calls in the `getContractCreator` function. This change ensures that if an error occurs during the execution of `owner` or `getRoleMember`, the function will return `null` instead of throwing an unhandled error.
### Detailed summary
- Wrapped the calls to `owner` and `getRoleMember` in a `try-catch` block.
- Changed the calls to `owner` and `getRoleMember` to use `await` for proper asynchronous handling.
- Ensured that if an error occurs, the function returns `null` instead of failing silently.
> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`
<!-- end pr-codex -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved error handling when retrieving contract creator information, ensuring failures no longer cause crashes and instead return a safe null value.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
a42e689 to
67c3d86
Compare

PR-Codex overview
This PR enhances error handling in the
getContractCreatorfunction by introducing atry-catchblock, allowing the function to gracefully returnnullin case of an error during the execution of theownerandgetRoleMembercalls.Detailed summary
try-catchblock around the logic to handle potential errors.return owner({...})toreturn await owner({...})for asynchronous handling.return getRoleMember({...})toreturn await getRoleMember({...})for asynchronous handling.Summary by CodeRabbit