HTTPErrorHandler { HTTPStatus httpStatus(Throwable e) { ResponseStatus responseStatus = e.getClass().getDeclaredAnnotation(ResponseStatus.class); if (responseStatus != null) return responseStatus.value(); if (e instanceof RemoteServiceException) return ((RemoteServiceException) e).status; return HTTPStatus.INTERNAL_SERVER_ERROR; } HTTPErrorHandler(ResponseHandler responseHandler);  public ErrorHandler customErrorHandler; }
@Test void httpStatus() { assertThat(handler.httpStatus(new RemoteServiceException("error", Severity.WARN, "error_code", HTTPStatus.BAD_REQUEST))) .isEqualTo(HTTPStatus.BAD_REQUEST); assertThat(handler.httpStatus(new NotFoundException("error"))).isEqualTo(HTTPStatus.NOT_FOUND); assertThat(handler.httpStatus(new Error())).isEqualTo(HTTPStatus.INTERNAL_SERVER_ERROR); }