-
Notifications
You must be signed in to change notification settings - Fork 672
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
Unhandled Promise Rejection on ALB event #678
Comments
Thanks for the report. Serverless Express catches errors and returns to a response to the event source with the error in a format expected by the event source. For example, API Gateway expects a https://github.com/CodeGenieApp/serverless-express/blob/mainline/src/configure.js#L72-L95 which catches the error, and https://github.com/CodeGenieApp/serverless-express/blob/mainline/src/transport.js#L62-L80 which determines how to respond. Note line 63 ALB is included in the list of services that will include a response format rather than throwing the error. If you really want to throw an error, you can do something like |
@brettstack I carefully looked into this once again and the call stack never shows a hit on https://github.com/CodeGenieApp/serverless-express/blob/mainline/src/configure.js#L86 .. so https://github.com/CodeGenieApp/serverless-express/blob/mainline/src/transport.js#L62-L80 which determines how to respond is never executed. I still get Unhandled Promise Rejection on this and never hitting either of
Please note: we have multi value headers enabled. Not sure if thats something of interest |
Given an ALB event with multiValueQueryStringParameters but one of the value fails
decodeURIComponent
, the promise isnt handled at all. Expectation is that it should return an error and consumers treat that errorserverless-express/src/event-sources/aws/alb.js
Line 40 in 1376bd0
serverless-express/src/event-sources/aws/alb.js
Line 17 in 1376bd0
The below test wont even report the failure since the promise is left unhandled
The text was updated successfully, but these errors were encountered: