code: private static void setErrorAttributes(CmsObject cms, Throwable throwable, HttpServletRequest request) {
  
          String errorUri = CmsFlexController.getThrowableResourceUri(request);
          if (errorUri == null) {
              errorUri = cms.getRequestContext().getUri();
          }
  
          // try to get the exception root cause
          Throwable cause = CmsFlexController.getThrowable(request);
          if (cause == null) {
              cause = throwable;
          }
  
          request.getSession().setAttribute(THROWABLE, cause);
          request.getSession().setAttribute(PATH, errorUri);
      }
docs: Sets the error attributes to the current session.<p>
  
  @param cms the cms context
  @param throwable the throwable
  @param request the current request