implement std::error::Error for RedisError and cleanup - #467
Open
JonasKruckenberg wants to merge 1 commit into
Open
implement std::error::Error for RedisError and cleanup#467JonasKruckenberg wants to merge 1 commit into
JonasKruckenberg wants to merge 1 commit into
Conversation
kei-nan
approved these changes
May 19, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates the crate’s internal error handling by making RedisError implement std::error::Error, centralizing string rendering via a new to_str() helper, and introducing typed variants for specific conversion failures (NUL / UTF-8).
Changes:
- Implement
fmt::Display+std::error::ErrorforRedisError, and addRedisError::to_str()for consistent error formatting. - Add new
RedisErrorvariants forNulErrorandUtf8Error, and wire them into existing call sites (e.g.,hash_get_multi). - Simplify
Context::replyerror handling to a singleErr(err)branch usingto_str().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/rediserror.rs |
Adds Error impl, to_str(), and new error variants; changes conversion behavior. |
src/raw.rs |
Maps CString::new NUL failures into a new RedisError variant. |
src/context/mod.rs |
Simplifies replying with errors by formatting all RedisErrors via to_str(). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kei-nan
requested changes
May 19, 2026
kei-nan
left a comment
Collaborator
There was a problem hiding this comment.
Asked copilot to review
@JonasKruckenberg can you take a look at the comments it left?
JonasKruckenberg
force-pushed
the
push-ysqyrtooqwlk
branch
from
May 21, 2026 12:21
27e579e to
ef2667c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.