@Test public void typedHandle_InvalidResponseObjectException_responseString() throws JsonProcessingException { AwsProxyResponse resp = exceptionHandler.handle(new InvalidResponseObjectException(INVALID_RESPONSE_MESSAGE, null)); assertNotNull(resp); String body = objectMapper.writeValueAsString(new ErrorModel(AwsProxyExceptionHandler.GATEWAY_TIMEOUT_ERROR)); assertEquals(body, resp.getBody()); }
@Override public AwsProxyResponse handle(Throwable ex) { log.error("Called exception handler for:", ex); ex.printStackTrace(); if (ex instanceof InvalidRequestEventException || ex instanceof InternalServerErrorException) { return new AwsProxyResponse(500, headers, getErrorJson(INTERNAL_SERVER_ERROR)); } else { return new AwsProxyResponse(502, headers, getErrorJson(GATEWAY_TIMEOUT_ERROR)); } }
AwsProxyExceptionHandler implements ExceptionHandler<AwsProxyResponse> { @Override public AwsProxyResponse handle(Throwable ex) { log.error("Called exception handler for:", ex); ex.printStackTrace(); if (ex instanceof InvalidRequestEventException || ex instanceof InternalServerErrorException) { return new AwsProxyResponse(500, headers, getErrorJson(INTERNAL_SERVER_ERROR)); } else { return new AwsProxyResponse(502, headers, getErrorJson(GATEWAY_TIMEOUT_ERROR)); } } }
AwsProxyExceptionHandler implements ExceptionHandler<AwsProxyResponse> { @Override public AwsProxyResponse handle(Throwable ex) { log.error("Called exception handler for:", ex); ex.printStackTrace(); if (ex instanceof InvalidRequestEventException || ex instanceof InternalServerErrorException) { return new AwsProxyResponse(500, headers, getErrorJson(INTERNAL_SERVER_ERROR)); } else { return new AwsProxyResponse(502, headers, getErrorJson(GATEWAY_TIMEOUT_ERROR)); } }  }
AwsProxyExceptionHandler implements ExceptionHandler<AwsProxyResponse> { @Override public AwsProxyResponse handle(Throwable ex) { log.error("Called exception handler for:", ex); ex.printStackTrace(); if (ex instanceof InvalidRequestEventException || ex instanceof InternalServerErrorException) { return new AwsProxyResponse(500, headers, getErrorJson(INTERNAL_SERVER_ERROR)); } else { return new AwsProxyResponse(502, headers, getErrorJson(GATEWAY_TIMEOUT_ERROR)); } }  @Override AwsProxyResponse handle(Throwable ex); @Override void handle(Throwable ex, OutputStream stream); }
AwsProxyExceptionHandler implements ExceptionHandler<AwsProxyResponse> { @Override public AwsProxyResponse handle(Throwable ex) { log.error("Called exception handler for:", ex); ex.printStackTrace(); if (ex instanceof InvalidRequestEventException || ex instanceof InternalServerErrorException) { return new AwsProxyResponse(500, headers, getErrorJson(INTERNAL_SERVER_ERROR)); } else { return new AwsProxyResponse(502, headers, getErrorJson(GATEWAY_TIMEOUT_ERROR)); } }  @Override AwsProxyResponse handle(Throwable ex); @Override void handle(Throwable ex, OutputStream stream);  }