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

fix(core): print error message correctly when lambda plugin fails. #11800

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

zhongweiy
Copy link
Contributor

@zhongweiy zhongweiy commented Oct 21, 2023

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...

Summary

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Full changelog

Issue reference

Fix #KAG-2844

@windmgc
Copy link
Member

windmgc commented Oct 22, 2023

Nice catch! But I think it should be better if it is being fixed in

return error(content)

And returning body.Message would be enough, what do you think? @zhongweiy

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...
@zhongweiy zhongweiy changed the title fix(core): print error message correctly when plugin fails. fix(core): print error message correctly when lambda plugin fails. Oct 23, 2023
@zhongweiy
Copy link
Contributor Author

Nice catch! But I think it should be better if it is being fixed in

return error(content)

And returning body.Message would be enough, what do you think? @zhongweiy

Keery, thanks! This makes sense. Such change reduces the scope of change.

@hanshuebner hanshuebner merged commit 38248da into master Oct 24, 2023
27 checks passed
@hanshuebner hanshuebner deleted the fix_msg branch October 24, 2023 12:45
windmgc pushed a commit that referenced this pull request Nov 2, 2023
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...
windmgc pushed a commit that referenced this pull request Nov 3, 2023
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...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants