-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add GetLatestErrorMessage feature #138
Conversation
Maybe a character array defined in commom.c is enough. IMO, we only save the latest error message in C module, the error message can set to the array directly, so the standalone method in CPP does not need. What do you think about it? |
I think this C API should be thread safe? |
I agree with your opinion,Define a character array in Common.c to save the latest error message. |
Maybe we can refer to the processing logic of linux errorno and only keep the last error message. once an error occurs, we need to retrieve the error information immediately. in order to achieve simple logic, the following error information is allowed to cover the old error information. |
@ShannonDing https://linux.die.net/man/3/errno
I think the error information should be thread-local just like linux errno. |
@wangjuneng Could you please check the CI result? |
extern "C" { | ||
#endif | ||
|
||
ROCKETMQCLIENT_API const char *GetLatestErrorMessage(); // Return the last error message |
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.
all files in this pr have wrong format, pls format them
What is the purpose of the change
Add GetLatestErrorMessage feature
Brief changelog
1、Add MQClientErrorContainer to save the latest error message
2、Provide C interface for getting the latest error message
3、Modify C interface CPullConsumer,CPushConsumer,CPushConsumer when occur error use MQClientErrorContainer save error message
Verifying this change
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.