-
Notifications
You must be signed in to change notification settings - Fork 522
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
fix: structure error returned without nested errors #2629
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (3)packages/api/src/client.ts (3)
The new error structure is more explicit and type-safe, properly defining all required fields. This change successfully addresses the nested error structure issue.
The implementation correctly aligns with the new error structure and uses clean destructuring pattern.
Let's verify that there are no remaining nested error structures in the codebase. ✅ Verification successfulBased on the comprehensive search results, I can now provide a final response: Error structure is consistently implemented across the codebase The error handling follows a consistent pattern throughout the codebase:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for potential nested error structures
ast-grep --pattern 'error: { error: $_ }'
# Search for direct error assignments that might not follow the new structure
rg 'error:\s*{(?![^}]*code:)' -g '*.ts'
Length of output: 202 Script: #!/bin/bash
# Search for error object structures in TypeScript files
ast-grep --pattern 'error: { $$ }'
# Also search for error response type definitions
ast-grep --pattern 'type ErrorResponse = { $$ }'
# Search for error-related return statements
ast-grep --pattern 'return { error: $$ }'
Length of output: 131 Script: #!/bin/bash
# Search for files containing error-related code with context
rg -A 2 -B 2 'error:' --type ts
# Search for ErrorResponse type usage
rg 'ErrorResponse' --type ts
# Look for error handling patterns
rg 'return.*error' --type ts
Length of output: 67227 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
packages/api/src/client.ts
(2 hunks)
🔇 Additional comments (1)
packages/api/src/client.ts (1)
99-104
: LGTM: Improved error structure with explicit typing
The new error structure properly flattens the error object and explicitly types all required properties. This change aligns well with the PR objective to eliminate nested errors.
simplify Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
What does this PR do?
Fixes # (issue)
#2387
eng-1447
If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists
Type of change
How should this be tested?
Checklist
Required
pnpm build
pnpm fmt
console.logs
git pull origin main
Appreciated
Summary by CodeRabbit
Summary by CodeRabbit
New Features
code
,message
,docs
, andrequestId
for improved clarity.Bug Fixes