Skip to content

Commit

Permalink
Fix error response
Browse files Browse the repository at this point in the history
The `error` field is not valid for an API Gateway response. As noted in the AWS docs below, when an error response contains invalid fields, it will always return a `502` error code with a body of `{"message": "Internal server error"}`. This PR updates the error response fields to contain valid fields and a more sensible response message.

- https://docs.aws.amazon.com/lambda/latest/dg/services-apigateway.html#services-apigateway-errors
  • Loading branch information
ajschmidt8 committed Mar 9, 2022
1 parent 2c1b25c commit 83a4e7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lambda-function.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function lambdaFunction(probot, event, context) {
} catch (error) {
return {
statusCode: error.status || 500,
error: "ooops",
body: "Error processing GitHub Event",
};
}
}

0 comments on commit 83a4e7c

Please sign in to comment.