Support "Task timed out" warnings as HTTP 504-errors

Currently if Lambda functions have a timeout then you will not see any errors in Cloudwatch, while the user gets a 200 http response code with `{ errorMessage: 'Task timed out in 10.0 s'}`. 

This change will show 5XX errors in Cloudwatch.

To support this I need to copy all the default patterns in `serverless.yml` per function, so therefore I think this need to be a default setting, while this is not caused by the Serverless(/our) code but by AWS Lambda itself.
This commit is contained in:
Joey van Dijk 2017-06-08 10:36:36 +02:00 committed by GitHub
parent 7d2b79b910
commit 660e0b3a8f

View File

@ -29,7 +29,7 @@ const DEFAULT_STATUS_CODES = {
pattern: '[\\s\\S]*\\[502\\][\\s\\S]*',
},
504: {
pattern: '[\\s\\S]*\\[504\\][\\s\\S]*',
pattern: '([\s\S]*\[504\][\s\S]*)|(^[Task timed out].*)',
},
};