@Override
  public Response toResponse(Throwable t) {
    int status = DEFAULT_STATUS;
    if (t instanceof WebApplicationException) {
      status = ((WebApplicationException) t).getResponse().getStatus();
    }
    SimpleHttpErrorInfo errorInfo = new SimpleHttpErrorInfo(status, t.getMessage());
    return Response.status(status).entity(errorInfo).type(MediaType.APPLICATION_JSON).build();
  }
@Test
  public void testToResponseWithGenericException() {
    // Arrange
    Throwable throwable = new RuntimeException("Internal Server Error");

    // Act
    Response response = _exceptionMapper.toResponse(throwable);

    // Assert
    assertEquals(response.getStatus(), 500);
    SimpleHttpErrorInfo errorInfo = (SimpleHttpErrorInfo) response.getEntity();
    assertEquals(errorInfo.getCode(), 500);
    assertEquals(errorInfo.getError(), "Internal Server Error");
  }