Cleanup of internal cluster error functions#93
Merged
bjosv merged 1 commit intovalkey-io:mainfrom Sep 13, 2024
Merged
Conversation
zuiderkwast
reviewed
Sep 11, 2024
Comment on lines
+211
to
+212
| } else if (str == NULL) { /* No known usecase. Clear previous errstr. */ | ||
| cc->errstr[0] = '\0'; |
Collaborator
There was a problem hiding this comment.
If this is never called, we should probably do an assert instead, right?
assert(str != NULL);
Collaborator
Author
There was a problem hiding this comment.
I have gone through a bit more, and it should be safe to assert.
Keeping the if-check part in case of NDEBUG, which is set by CMake in release builds.
The error string for VALKEY_ERR_IO is set by the standalone API, so removing the special handling for it. Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
692410c to
e7b0c0f
Compare
zuiderkwast
approved these changes
Sep 12, 2024
Comment on lines
+205
to
+206
| assert(str != NULL); | ||
| if (str != NULL && str != cc->errstr) { |
Collaborator
There was a problem hiding this comment.
Some redundant check there in if...
Suggested change
| assert(str != NULL); | |
| if (str != NULL && str != cc->errstr) { | |
| assert(str != NULL); | |
| if (str != cc->errstr) { |
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.
Add internal convenience functions to clear errors, and cleanup the internal
SetErrorfunctions.The error string for
VALKEY_ERR_IOis set by the standalone API, so removing the handling for it in the cluster part.