private static int getStatusCode(Throwable t) {
        if (t instanceof BindingNotFoundException || t instanceof BindingSetNotFoundException) {
            return HttpStatus.NOT_FOUND_404;
        } else if (t instanceof RequestException) {
            return ((RequestException) t).getResponseStatus();
        } else if (t instanceof TimeoutException) {
            // E.g stream idle timeout for HTTP/2
            return HttpStatus.SERVICE_UNAVAILABLE_503;
        } else {
            return HttpStatus.INTERNAL_SERVER_ERROR_500;
        }
    }
A {@link ResponseHandler} that writes the response to Jetty ({@link org.eclipse.jetty.server.Response}).

@author bjorncs
container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JettyResponseWriter.java