-
Notifications
You must be signed in to change notification settings - Fork 277
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
fix: handle unknown errcode #132
Conversation
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.
Thanks, please also fix the similar Errors[errcode]
places.
lib/resty/kafka/producer.lua
Outdated
err = Errors[errcode] | ||
if not err then | ||
-- fallback any unknown errcode to UNKNOWN_SERVER_ERROR | ||
err = Errors[-1] | ||
end |
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.
err = Errors[errcode] | |
if not err then | |
-- fallback any unknown errcode to UNKNOWN_SERVER_ERROR | |
err = Errors[-1] | |
end | |
err = Errors[errcode] or Errors[-1] |
this is better.
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.
Done.
Alright, wait a sec. |
also fix errcode not used
local variable Co-authored-by: doujiang <[email protected]>
#131