Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe changes introduce a new documentation file on customizing error responses in oRPC OpenAPI handlers, update the sidebar configuration to include this new topic, and revise an existing sequence diagram in the RPC handler documentation to clarify the request/response encoding flow and error handling. Changes
Sequence Diagram(s)sequenceDiagram
participant P1 as HTTP Request
participant P2 as RPCHandler
participant P3 as Request/Response Encoder
participant P4 as Router & Input/Output Encoder
participant P5 as Server-side Procedure Client
P1->>P2: Incoming HTTP Request
P2->>P3: Parse Request
P3->>P3: Convert Request
P3->>P4: Forward Standard Request
P4->>P5: Call Procedure
P5-->>P4: Response (Success/Failure)
alt Success
P4->>P3: Encode Output
else Failure
P4->>P3: Encode Error (End of Interceptors)
end
P3->>P2: Formulate HTTP Response
P2->>P1: Send HTTP Response
Suggested labels
Poem
✨ 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 (
|
There was a problem hiding this comment.
Summary of Changes
Hello @unnoq, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces new documentation to guide users on customizing error response formats within oRPC OpenAPI handlers, complete with practical code examples. Additionally, I've refined existing architectural diagrams to provide clearer insights into the request processing and error handling flows within the RPC handler's lifecycle.
Highlights
- New Documentation: I've added a comprehensive new documentation page at
/docs/openapi/advanced/customizing-error-response.md. This page guides users on how to customize the error response format in oRPC OpenAPI handlers, primarily utilizingrootInterceptors. - Documentation Navigation Update: The navigation sidebar configuration in
apps/content/.vitepress/config.tshas been updated. The new 'Customizing Error Response' page is now accessible under the 'Advanced' section within the OpenAPI documentation, and the links have been reordered for alphabetical consistency. - RPC Handler Diagram Refinement: I've enhanced the
rpc-handlerlifecycle sequence diagram inapps/content/docs/rpc-handler.md. The diagram now more clearly illustrates the 'Convert' step withinrootInterceptorsand provides a more detailed breakdown of the success and failure paths for encoding responses and errors afterclientInterceptors.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request adds documentation for customizing the error response format. A new page is created with a code example and an important warning. The changes also include updating the sidebar navigation and clarifying a sequence diagram related to the request/response lifecycle.
I've found a minor syntax issue in the new documentation file that could affect rendering. My review includes a suggestion to fix it.
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
More templates
@orpc/arktype
@orpc/client
@orpc/contract
@orpc/experimental-durable-event-iterator
@orpc/hey-api
@orpc/nest
@orpc/openapi
@orpc/openapi-client
@orpc/react
@orpc/react-query
@orpc/server
@orpc/shared
@orpc/solid-query
@orpc/standard-server
@orpc/standard-server-aws-lambda
@orpc/standard-server-fetch
@orpc/standard-server-node
@orpc/standard-server-peer
@orpc/svelte-query
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/vue-colada
@orpc/vue-query
@orpc/zod
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
apps/content/.vitepress/config.ts (1)
233-236: Consider keeping subsection items consistently ordered
Most side-bar subsections are sorted either alphabetically or by conceptual flow. “Customizing Error Response” jumps to the top, which is OK if you intentionally want to promote it, but it does break the existingSerializer → Redirectordering. If prominence is not required, re-ordering for consistency may help users locate topics faster.apps/content/docs/rpc-handler.md (1)
115-132: Use Mermaidalt/elseblocks for clearer success-vs-failure branching
Having two plain arrows (if success,if failed) makes the sequence harder to read and doesn’t visually group mutually-exclusive paths. Mermaid supportsalt … else … end, which keeps the diagram tidy and self-explanatory:P4 ->> P5: Input, Signal, LastEventId,... Note over P5: clientInterceptors P5 ->> P5: Handle - P5 ->> P4: if success - P4 ->> P4: Encode output - P5 ->> P4: if failed - Note over P4: end interceptors - P4 ->> P4: Encode error + alt success + P5 ->> P4: result + P4 ->> P4: Encode output + else failure + P5 ->> P4: error + Note over P4: end interceptors + P4 ->> P4: Encode error + endPurely a documentation polish, but worth considering for readability.
apps/content/docs/openapi/advanced/customizing-error-response.md (1)
8-9: Link to the OpenAPI handler, not the RPC handler
rootInterceptorsfor OpenAPI users live under/docs/openapi/openapi-handler, so the hyperlink should reflect that to avoid context-switching confusion.-If you need to customize the error response format to match your application's requirements, you can use [`rootInterceptors`](/docs/rpc-handler#lifecycle) in the handler. +If you need to customize the error response format to match your application's requirements, you can use [`rootInterceptors`](/docs/openapi/openapi-handler#rootInterceptors) in the handler.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/content/.vitepress/config.ts(1 hunks)apps/content/docs/openapi/advanced/customizing-error-response.md(1 hunks)apps/content/docs/rpc-handler.md(2 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/content/docs/openapi/advanced/customizing-error-response.md
[uncategorized] ~8-~8: A punctuation mark might be missing here.
Context: ...application's requirements, you can use [rootInterceptors](/docs/rpc-handler#lif...
(AI_EN_LECTOR_MISSING_PUNCTUATION)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: lint
- GitHub Check: publish-commit
Summary by CodeRabbit