public class AwsProxyExceptionHandler extends Object implements ExceptionHandler<AwsProxyResponse>
ExceptionHandler object that returns AwsProxyResponse objects.
Returns application/json messages with a status code of 500 when the RequestReader failed to read the incoming event.
For all other exceptions returns a 502. Responses are populated with a JSON object containing a message property.ExceptionHandler| Constructor and Description |
|---|
AwsProxyExceptionHandler() |
| Modifier and Type | Method and Description |
|---|---|
AwsProxyResponse |
handle(Throwable ex)
The handle method is called by the container object whenever an exception occurs in the
proxy method
for typed calls |
void |
handle(Throwable ex,
OutputStream stream)
This handle implementation is called whenever an exception occurs in the stream-based
proxy method. |
public AwsProxyResponse handle(Throwable ex)
ExceptionHandlerproxy method
for typed callshandle in interface ExceptionHandler<AwsProxyResponse>ex - The exception thrown by the applicationpublic void handle(Throwable ex, OutputStream stream) throws IOException
ExceptionHandlerproxy method.handle in interface ExceptionHandler<AwsProxyResponse>ex - The exception thrown by the applicationstream - The OutputStream where the exception will be writtenIOException - When the exception handler fails to write to the OutputStreamCopyright © 2017. All Rights Reserved.