Q155. API gateway and Lambda non-proxy integrations have been chosen to implement an application by a software engineer. The application is a data analysis tool that returns some statistic results when the HTTP endpoint is called. The lambda needs to communicate with some back-end data services such as Keen.io however there are chances that error happens such as wrong data requested bad communications etc. The lambda is written using Java and two exceptions may be returned which are BadRequestException and InternalErrorException. What should the software engineer do to map these two exceptions in API gateway with proper HTTP return codes? For example
BadRequestException and InternalErrorException are mapped to HTTP return codes 400 and 500 respectively. Select 2.
A.Add the corresponding error codes (400 and 500) on the Integration Response in API gateway B.Add the corresponding error codes (400 and 500) on the Method Response in API gateway. C.Put the mapping logic into Lambda itself so that when exception happens error codes are returned at the same time in a JSON body. D.Add Integration Responses where regular expression patterns are set such as BadRequest or InternalError. Associate them with HTTP status codes E.Add Method Responses where regular expression patterns are set such as BadRequest or InternalError. Associate them with HTTP status codes 400 and 500.正确答案BD