class HttpServletResponseWrapper extends HttpServerResponse {

  @Override public int statusCode() {
    int result = ServletRuntime.get().status(response);
    if (caught != null && result == 200) { // We may have a potentially bad status due to defaults
      // Servlet only seems to define one exception that has a built-in code. Logic in Jetty
      // defaults the status to 500 otherwise.
      if (caught instanceof UnavailableException) {
        return ((UnavailableException) caught).isPermanent() ? 404 : 503;
      }
      return 500;
    }
    return result;
  }

    HttpServletResponseWrapper(@Nullable HttpServletRequest request, HttpServletResponse response,
    @Nullable Throwable caught);

}