Fix API Gateway error responses#187
Merged
christophgysin merged 8 commits intoSep 15, 2017
Merged
Conversation
Contributor
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As earlier discussed in issue #186, I took the liberty of (hopefully) updating all
aws-node-...examples with lamdas that responds to API Gateway-events and changed their error responses so that they respond correctly.I also want to point out that I haven't changed the structure of the code or anything. I have only changed the original callbacks, e.g.:
I have transformed them so that the lambdas ”don't think” that an error occured, e.g.:
In the first case an http request would always return a
502 Bad Gatewayresponse. But in the latter case the response would be more correct and give useful feedback to users.I have tried to keep the errors as close to the original as possible, and sometimes I have guessed on a suitable statusCode and message.
I hope that it is okey that I made this into a larger PR, instead of splitting it up into one PR per example.
This PR resolves #186.