Skip to content

Commit

Permalink
fix(core): print error message correctly when plugin fails.
Browse files Browse the repository at this point in the history
Before the fix, error message is:
[kong] init.lua:405 [aws-lambda] table: 0x04183d70, client:127.0.0.1...

After:
[kong] init.lua:405 [aws-lambda] Function not found: arn:aws:lambda:us-east-1:xxx:function:test-lambda-2, client: 127.0.0.1...
  • Loading branch information
zhongweiy committed Oct 23, 2023
1 parent 920ba98 commit 56ca435
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/unreleased/kong/fix-error-message-print.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
message: print error message correctly when plugin fails
type: bugfix
scope: Core
2 changes: 1 addition & 1 deletion kong/plugins/aws-lambda/handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function AWSLambdaHandler:access(conf)

local content = res.body
if res.status >= 400 then
return error(content)
return error(content.Message)
end

-- TRACING: set KONG_WAITING_TIME stop
Expand Down

0 comments on commit 56ca435

Please sign in to comment.