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: return 500 Internal Server Error on python error #1796

Merged
merged 6 commits into from
Aug 30, 2024

Conversation

paneidos
Copy link
Contributor

Description

Return a 500 Internal Server Error when the Python handler raises an error

Motivation and Context

When (Python) code raises an error, AWS Lambda returns a 500 with a generic JSON response.
With this change the behaviour of Serverless Offline is more inline with AWS Lambda.

How Has This Been Tested?

Added an automated test for Python.

Screenshots (if appropriate):

@DorianMazur DorianMazur changed the title Raise 500 on python error fix: return 500 Internal Server Error on python error Jun 15, 2024
Copy link
Owner

@dherault dherault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good PR, thanks for the solve. Do you want it in v13 (serverless v3) or v14 (serverless v4) or both?

@paneidos
Copy link
Contributor Author

Good PR, thanks for the solve. Do you want it in v13 (serverless v3) or v14 (serverless v4) or both?

Thanks!

I'd love to see it go to both, as I'm currently still on serverless v3 with most projects.

@dherault
Copy link
Owner

I'll see if I can squeeze that this week

@dherault
Copy link
Owner

Sorry for the delay, I'll see that it is merged

@dherault dherault merged commit 8512a10 into dherault:master Aug 30, 2024
0 of 9 checks passed
dherault added a commit that referenced this pull request Aug 30, 2024
fix: return 500 Internal Server Error on python error
@dherault
Copy link
Owner

Sorry but I had to revert your PR because of failing test. Please open a new one if you want it merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants