Implement unified response and error types#128
Conversation
Reviewer's GuideThis PR introduces a unified response and error handling model by adding the Response and WireframeError enums (with convenience impls and type alias), re-exports them at the crate root, and updates the project documentation to disable a lint rule and mark the roadmap item as complete. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Warning Rate limit exceeded@leynos has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 28 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant Handler
participant Response
participant Client
Handler->>Response: Produce Response<F, E> (Single, Vec, Stream, or Empty)
Response-->>Client: Deliver frames or error (WireframeError<E>)
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate Unit Tests
🪧 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.
Hey @leynos - I've reviewed your changes - here's some feedback:
- Consider deriving Debug (and potentially Clone/PartialEq) on Response and WireframeError to improve logging and testing ergonomics.
- Add From and From<Vec> implementations for Response<F, E> so handlers can return single or multiple frames without explicit wrapping.
- Implement a From for WireframeError (in addition to the existing std::io::Error conversion) to streamline propagating protocol errors.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider deriving Debug (and potentially Clone/PartialEq) on Response and WireframeError to improve logging and testing ergonomics.
- Add From<F> and From<Vec<F>> implementations for Response<F, E> so handlers can return single or multiple frames without explicit wrapping.
- Implement a From<E> for WireframeError<E> (in addition to the existing std::io::Error conversion) to streamline propagating protocol errors.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey @leynos - I've reviewed your changes and found some issues that need to be addressed.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Summary
ResponseandWireframeErrorenumsTesting
make fmtmake lintmake testmarkdownlint *.md **/*.mdmdformat-allhttps://chatgpt.com/codex/tasks/task_e_685b239b2868832296e4ac7b899c82cc
Summary by Sourcery
Implement unified response and error types, expose them at the crate root, and update documentation to reflect and format these additions.
New Features:
Enhancements:
Documentation: