mirror of
https://github.com/hanzokv/go.git
synced 2026-09-24 00:31:51 +00:00
chore: finish the vocabulary sweep — KV_ERROR, not REDIS_ERROR
Last of our own naming to move. The error-code fixture in the wrapping test (and
the README example that mirrors it) still said REDIS_ERROR.
What intentionally remains, and why:
RediSearch — names a specific external module that the FT.* commands map to.
It is an address, not our vocabulary.
StoreDist — matches a case-insensitive search for "redis" by accident
(sto-reDis-t). Not the word.
RELEASE-NOTES.md — a changelog of what upstream shipped. Rewriting history to
pretend it used our names would make it wrong.
This commit is contained in:
@@ -477,7 +477,7 @@ func (h MyHook) ProcessHook(next kv.ProcessHook) kv.ProcessHook {
|
||||
if err != nil {
|
||||
// Wrap with custom error type
|
||||
wrappedErr := &AppError{
|
||||
Code: "REDIS_ERROR",
|
||||
Code: "KV_ERROR",
|
||||
RequestID: getRequestID(ctx),
|
||||
Err: err,
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ func TestCustomErrorTypeWrapping(t *testing.T) {
|
||||
cmd1 := kv.NewStatusCmd(testCtx, "GET", "key")
|
||||
loadingErr := proto.ParseErrorReply([]byte("-LOADING KV is loading the dataset in memory"))
|
||||
customErr1 := &AppError{
|
||||
Code: "REDIS_ERROR",
|
||||
Code: "KV_ERROR",
|
||||
Message: "Database operation failed",
|
||||
RequestID: "req-12345",
|
||||
Err: loadingErr,
|
||||
@@ -398,7 +398,7 @@ func TestCustomErrorTypeWrapping(t *testing.T) {
|
||||
|
||||
// Verify error message contains custom context
|
||||
errMsg := cmd1.Err().Error()
|
||||
if !contains(errMsg, "REDIS_ERROR") || !contains(errMsg, "req-12345") {
|
||||
if !contains(errMsg, "KV_ERROR") || !contains(errMsg, "req-12345") {
|
||||
t.Errorf("Error message missing custom error context: %v", errMsg)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user