mirror of
https://github.com/serverless/serverless.git
synced 2026-01-25 15:07:39 +00:00
Capture Exception in handler with 500 status code
This commit is contained in:
parent
41260b834e
commit
bb2ca44623
@ -99,19 +99,19 @@ module.exports = {
|
||||
"method": "$context.httpMethod",
|
||||
"principalId": "$context.authorizer.principalId",
|
||||
"stage": "$context.stage",
|
||||
|
||||
|
||||
#set( $map = $input.params().header )
|
||||
"headers": $loop,
|
||||
|
||||
|
||||
#set( $map = $input.params().querystring )
|
||||
"query": $loop,
|
||||
|
||||
|
||||
#set( $map = $input.params().path )
|
||||
"path": $loop,
|
||||
|
||||
|
||||
#set( $map = $context.identity )
|
||||
"identity": $loop,
|
||||
|
||||
|
||||
#set( $map = $stageVariables )
|
||||
"stageVariables": $loop
|
||||
}
|
||||
@ -331,7 +331,9 @@ module.exports = {
|
||||
{ StatusCode: 403, SelectionPattern: '.*\\[403\\].*' },
|
||||
{ StatusCode: 404, SelectionPattern: '.*\\[404\\].*' },
|
||||
{ StatusCode: 422, SelectionPattern: '.*\\[422\\].*' },
|
||||
{ StatusCode: 500, SelectionPattern: '.*\\[500\\].*' },
|
||||
{ StatusCode: 500,
|
||||
SelectionPattern:
|
||||
'.*(Process\\s?exited\\s?before\\s?completing\\s?request|\\[500\\]).*' },
|
||||
{ StatusCode: 502, SelectionPattern: '.*\\[502\\].*' },
|
||||
{ StatusCode: 504, SelectionPattern: '.*\\[504\\].*' }
|
||||
);
|
||||
|
||||
@ -664,7 +664,8 @@ describe('#compileMethods()', () => {
|
||||
expect(
|
||||
awsCompileApigEvents.serverless.service.provider.compiledCloudFormationTemplate
|
||||
.Resources.ApiGatewayMethodUsersListGet.Properties.Integration.IntegrationResponses[6]
|
||||
).to.deep.equal({ StatusCode: 500, SelectionPattern: '.*\\[500\\].*' });
|
||||
).to.deep.equal({ StatusCode: 500,
|
||||
SelectionPattern: '.*(Process\\s?exited\\s?before\\s?completing\\s?request|\\[500\\]).*' });
|
||||
expect(
|
||||
awsCompileApigEvents.serverless.service.provider.compiledCloudFormationTemplate
|
||||
.Resources.ApiGatewayMethodUsersListGet.Properties.Integration.IntegrationResponses[7]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user