Skip to content

Commit 5885ea4

Browse files
committed
chore(pdk): set stack rewind to 3 to display the correct line when doing phase check
1 parent c400ef2 commit 5885ea4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kong/pdk/private/phases.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ local function check_not_phase(rejected_phases)
102102

103103
local current_phase = ngx.ctx.KONG_PHASE
104104
if not current_phase then
105-
error("no phase in ngx.ctx.KONG_PHASE")
105+
error("no phase in ngx.ctx.KONG_PHASE", 3)
106106
end
107107

108108
if band(current_phase, rejected_phases) == 0 then
@@ -115,7 +115,7 @@ local function check_not_phase(rejected_phases)
115115
error(fmt("function cannot be called in %s phase (can be called in any " ..
116116
"phases except: %s)",
117117
current_phase_name,
118-
table.concat(rejected_phases_names, ", ")))
118+
table.concat(rejected_phases_names, ", ")), 3)
119119
end
120120

121121

0 commit comments

Comments
 (0)