refactor(server): simplify error creation from unknown causes#6778
refactor(server): simplify error creation from unknown causes#6778Nick-Lucas merged 1 commit intotrpc:mainfrom
Conversation
Updated the `getCauseFromUnknown` function to use `Object.assign` for creating a synthetic `UnknownCauseError` from an object, improving code readability and efficiency.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
@braden-w is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe code refactors the Changes
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 (
|
@trpc/client
@trpc/next
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
|
This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you. |
Updated the
getCauseFromUnknownfunction to useObject.assignfor creating a syntheticUnknownCauseErrorfrom an object, improving code readability.🎯 Changes
What changes are made in this PR? Is it a feature or a bug fix?
cause, then we shouldn't merge, sinceObject.assigncopies only enumerable properties (not inherited ones).✅ Checklist
Summary by CodeRabbit