Skip to content

Commit

Permalink
chore(pdk): set stack rewind to 3 to display the correct line when do…
Browse files Browse the repository at this point in the history
…ing phase check
  • Loading branch information
fffonion committed Feb 10, 2025
1 parent 04f8094 commit ae9b972
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kong/pdk/private/phases.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,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 @@ -115,7 +115,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

0 comments on commit ae9b972

Please sign in to comment.