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

chore(pdk): set stack rewind to 3 to display the correct line when do… #13809

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions kong/pdk/private/phases.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ local function check_phase(accepted_phases)
current_phase = PHASES.admin_api
else
error(fmt("no phase in ngx.ctx.KONG_PHASE, (need one of %s)",
table.concat(get_phases_names(accepted_phases), ", ")))
table.concat(get_phases_names(accepted_phases), ", ")), 3)
end
end

Expand All @@ -89,7 +89,7 @@ local function check_phase(accepted_phases)

error(fmt("function cannot be called in %s phase (only in: %s)",
current_phase_name,
table.concat(accepted_phases_names, ", ")))
table.concat(accepted_phases_names, ", ")), 3)
end


Expand All @@ -101,7 +101,7 @@ local function check_not_phase(rejected_phases)

local current_phase = ngx.ctx.KONG_PHASE
if not current_phase then
error("no phase in ngx.ctx.KONG_PHASE")
error("no phase in ngx.ctx.KONG_PHASE", 3)
end

if band(current_phase, rejected_phases) == 0 then
Expand All @@ -114,7 +114,7 @@ local function check_not_phase(rejected_phases)
error(fmt("function cannot be called in %s phase (can be called in any " ..
"phases except: %s)",
current_phase_name,
table.concat(rejected_phases_names, ", ")))
table.concat(rejected_phases_names, ", ")), 3)
end


Expand Down
Loading