Skip to content
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

Print error code #2800

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Print error code #2800

wants to merge 4 commits into from

Conversation

NopeDl
Copy link
Contributor

@NopeDl NopeDl commented Oct 12, 2023

What problem does this PR solve?

Issue Number: #2185

What is changed and how it works?

What's Changed: print error code with more meaningful name

How it Works: use the function to convert error code to string

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • Relevant documentation/comments is changed or added
  • I acknowledge that all my contributions will be made under the project's license

@NopeDl NopeDl force-pushed the print-error-code branch 5 times, most recently from 771b668 to 44cf9e1 Compare October 13, 2023 16:02
@NopeDl
Copy link
Contributor Author

NopeDl commented Oct 13, 2023

cicheck

Signed-off-by: NopeDl <h2012497638@outlook.com>
@wu-hanqing
Copy link
Contributor

cicheck

2 similar comments
@YunhuiChen
Copy link
Contributor

cicheck

@Cyber-SiKu
Copy link
Contributor

cicheck

add topology support and remove storage status

Signed-off-by: NopeDl <h2012497638@outlook.com>
@NopeDl
Copy link
Contributor Author

NopeDl commented Oct 24, 2023

cicheck

@wu-hanqing wu-hanqing self-requested a review October 27, 2023 03:21
@@ -47,6 +47,27 @@ const int kCsClientReturnFail = -5;
// error code: chunkserver offline
const int kCsClientCSOffline = -6;

const char* PrintMdsDescByErrorCode(int code) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const char* PrintMdsDescByErrorCode(int code) {
inline const char* MdsErrCodeToName(int code) {

@@ -104,6 +125,59 @@ const int kTopoErrCodePoolsetNotFound = -20;
const int kTopoErrCodeCannotDeleteDefaultPoolset = -21;
const int kTopoErrCodeConflictBlockSizeAndChunkSize = -22;

const char* PrintTopoErrCodeDescription(int code) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const char* PrintTopoErrCodeDescription(int code) {
inline const char* TopoErrCodeToName(int code) {

Signed-off-by: NopeDl <h2012497638@outlook.com>
@wuhongsong
Copy link
Contributor

@NopeDl continue?

@@ -47,6 +47,27 @@ const int kCsClientReturnFail = -5;
// error code: chunkserver offline
const int kCsClientCSOffline = -6;

inline char* MdsErrCodeToName(int code) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
inline char* MdsErrCodeToName(int code) {
inline const char* MdsErrCodeToName(int code) {

@Ziy1-Tan
Copy link
Contributor

cicheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants