class HttpServletRequestWrapper extends HttpServerRequest {

  @Nullable Throwable maybeError() {
    Object maybeError = delegate.getAttribute("error");
    if (maybeError instanceof Throwable) return (Throwable) maybeError;
    maybeError = delegate.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
    if (maybeError instanceof Throwable) return (Throwable) maybeError;
    return null;
  }

    HttpServletRequestWrapper(HttpServletRequest delegate);

}