-
Notifications
You must be signed in to change notification settings - Fork 457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(error): unify error by adding Redis error codes for Status #2362
Merged
Merged
Changes from 8 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
175335a
chore(error): explicitly assign the type in Redis error
git-hulk bbdaf19
Allow to use Status in Redis::Error
git-hulk ddd125b
Rename ErrorType to ErrorKind
git-hulk 6c1f173
Fix build error
git-hulk 9103862
Use the error status to replace the error output
git-hulk fb342c9
Use ErrorKind::* to replace the error string
git-hulk 4d1020e
Fix wrong message in Lua
git-hulk 045b087
Move the error kind inside status
git-hulk 3684950
Fix error message
git-hulk 60cd76b
Fix wrong error message
git-hulk 89a61d8
Rename
git-hulk ab7a8b9
Merge branch 'unstable' into unify-error-message
PragmaTwice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ class CommandPSync : public Commander { | |
srv->stats.IncrPSyncOKCount(); | ||
s = srv->AddSlave(conn, next_repl_seq_); | ||
if (!s.IsOK()) { | ||
std::string err = redis::Error(s.Msg()); | ||
std::string err = redis::Error(s); | ||
s = util::SockSend(conn->GetFD(), err, conn->GetBufferEvent()); | ||
if (!s.IsOK()) { | ||
LOG(WARNING) << "failed to send error message to the replica: " << s.Msg(); | ||
|
@@ -230,7 +230,7 @@ class CommandFetchMeta : public Commander { | |
std::string files; | ||
auto s = engine::Storage::ReplDataManager::GetFullReplDataInfo(srv->storage, &files); | ||
if (!s.IsOK()) { | ||
s = util::SockSend(repl_fd, redis::Error("can't create db checkpoint"), bev); | ||
s = util::SockSend(repl_fd, redis::Error({Status::RedisErrorNoPrefix, "can't create db checkpoint"}), bev); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If here it's because we forget to add the prefix, we should fix it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the above comment. |
||
if (!s.IsOK()) { | ||
LOG(WARNING) << "[replication] Failed to send error response: " << s.Msg(); | ||
} | ||
|
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's really no prefix? Or just because we forget to add the prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this. I found we have some places that didn't align with Redis, but I suggest revising and fixing them in another PR: #2362 (comment)