1 Answer
- Newest
- Most votes
- Most comments
0
Hi,
It seems that you want to trap errors returned by your application at the API GTW level.
The right way to do it is described here: https://docs.aws.amazon.com/apigateway/latest/developerguide/handle-errors-in-lambda-integration.html
For what you're after (selection pattern), it's described in this section of the above link
To map the standard Lambda error to a method response, you must first decide on
an HTTP status code for a given Lambda error. You then set a regular expression pattern
on the selectionPattern property of the IntegrationResponse associated with the given
HTTP status code. In the API Gateway console, this selectionPattern is denoted as Lambda
error regex in the Integration response section, under each integration response.
Note
API Gateway uses Java pattern-style regexes for response mapping. For more information,
see Pattern in the Oracle documentation.
Best,
Didier