diff --git a/kong/pdk/private/phases.lua b/kong/pdk/private/phases.lua index d3a2bca57179..03d7fd168787 100644 --- a/kong/pdk/private/phases.lua +++ b/kong/pdk/private/phases.lua @@ -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 @@ -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 @@ -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 @@ -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