code: public static int parseHttpStatus(Throwable exception) {
          int status = 500;
          Exception ex = Requests.getProperty(DefaultExceptionMapper.BEFORE_EXCEPTION_KEY);
          if (ex != null) {
              exception = ex;
          }
          if (exception instanceof InternalServerErrorException) {
              if (exception.getCause() instanceof MessageBodyProviderNotFoundException) {
                  MessageBodyProviderNotFoundException e = (MessageBodyProviderNotFoundException) exception.getCause();
                  if (e.getMessage().startsWith("MessageBodyReader")) {
                      status = 415;
                  } else if (e.getMessage().startsWith("MessageBodyWriter")) {
                      status = 406;
                  }
              }
          } else if (exception instanceof WebApplicationException) {
              status = ((WebApplicationException) exception).getResponse().getStatus();
          } else if (exception instanceof FileNotFoundException) {
              status = 404;
          }
          return status;
      }
docs: <p>parseHttpStatus.</p>
  
  @param exception a {@link java.lang.Throwable} object.
  @return a int.