I want able to identify errors related to the Lambda function service when using HTTP API gateway Lambda integration, not the exceptions related to my application running on using the Lambda function.
An example of this is an error related to the Lambda function concurrency. If I invoke a Lambda function too many times in parallel (beyond its concurrency limit), I get a 503 error with the following response:
{
message: 'Service Unavailable'
}
I want the API response to include more information through which I can identify that this is a service exception, not an exception in my code.
I realize that my application (Lambda function code) I can avoid returning the above error message when another 503 error occurs, and then I can check for a "Service Unavailable" message to identify Lambda concurrency issues, but I was looking for a more customizable and formal method.