fix(dns): correct error() call in dns client initialization#13358
Merged
Conversation
| commit2: 0 | ||
| peek4: 0 | ||
| commit3: rejected | ||
|
|
Contributor
There was a problem hiding this comment.
we need three empty lines in between tests.
Contributor
|
A similar error occurs in apisix/discovery/dns/init.lua:81 |
Contributor
Author
|
Hi @hachi029, thank you for pointing that out! I will fix the similar issue in apisix/discovery/dns/init.lua:81 and include it in this PR. |
nic-6443
reviewed
Jun 11, 2026
error()'s second argument is the level, not a message part, so the
original error("...: ", err) dropped err (or raised a bad-argument
error). Concatenate err into the message instead.
d032184 to
b35aa23
Compare
nic-6443
approved these changes
Jul 7, 2026
shreemaan-abhishek
approved these changes
Jul 7, 2026
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.
Summary
Fixes #13357
Changes
In
apisix/plugins/limit-count/init.luaat line 262, theerror()function was called with incorrect arguments:
Lua's
error(message, level)expects the second argument to be aninteger (stack level: 0, 1, or 2), not a string. The previous code
would cause LuaJIT to raise:
Test
Added a test case in
t/plugin/limit-count5.tto verify the errormessage is correct when
_meta.parentis missing.