Method getErrorPageByExceptionType.

@param th
@return ErrorPage
180906
public ErrorPage getErrorPageTraverseRootCause(Throwable th) {
        while (th != null && th instanceof ServletException) { // defect 155880
            // - Check
            // rootcause !=
            // null
            Throwable rootCause = ((ServletException) th).getRootCause();
            if (rootCause == null) {
                break;
            }
            ErrorPage er = getErrorPageByExceptionType(th);
            if (er != null)
                return er;

            th = rootCause;
        }
        if (th != null)
            return getErrorPageByExceptionType(th);
        return null;
    }
604802
public static String getExceptionStacktrace(Throwable t) {
        try (StringWriter errors = new StringWriter()) {
            t.printStackTrace(new PrintWriter(errors));
            return errors.toString();
        } catch (IOException e) {
            LOG.error(e);
            return null;
        }
    }
73689
public String removeErrorPage(String error)
    {
        if (_errorPages == null)
            return null;
        return (String)_errorPages.remove(error);
    }
234626
private String findErrorPage(Throwable exception) {
        if (exception instanceof EJBException && exception.getCause() != null) {
            exception = exception.getCause();
        }
        String errorPage = WebXml.INSTANCE.findErrorPageLocation(exception);

        return errorPage;
    }
568124
private String getCustomReloginErrorPage(HttpServletRequest req) {
        String reLogin = CookieHelper.getCookieValue(req.getCookies(), ReferrerURLCookieHandler.CUSTOM_RELOGIN_URL_COOKIENAME);
        if (reLogin != null && reLogin.length() > 0) {
            if (reLogin.indexOf("?") < 0)
                reLogin += "?error=error";
        }
        return reLogin;
    }
1244982
public static GoCardlessApiException toException(ApiErrorResponse error) {
        switch (error.getType()) {
            case GOCARDLESS:
                return new GoCardlessInternalException(error);
            case INVALID_API_USAGE:
                return new InvalidApiUsageException(error);
            case INVALID_STATE:
                return new InvalidStateException(error);
            case VALIDATION_FAILED:
                return new ValidationFailedException(error);
        }
        throw new IllegalStateException("Unknown error type: " + error.getType());
    }
142920
protected ErrorInfo getErrorInfo(IOException e) {
    GoogleJsonError gjre = getDetails(e);
    if (gjre != null) {
      return getErrorInfo(gjre);
    }
    return null;
  }
501258
@JsonIgnore
    public String getErrorMessage() {
        return (params.length == 0) ? exceptionCode.getMessageTemplate() :
                String.format(exceptionCode.getMessageTemplate(), params);
    }
46685
public List<ErrorPageType<WebFragmentType<T>>> getAllErrorPage()
   {
      List<ErrorPageType<WebFragmentType<T>>> list = new ArrayList<ErrorPageType<WebFragmentType<T>>>();
      List<Node> nodeList = childNode.get("error-page");
      for(Node node: nodeList)
      {
         ErrorPageType<WebFragmentType<T>>  type = new ErrorPageTypeImpl<WebFragmentType<T>>(this, "error-page", childNode, node);
         list.add(type);
      }
      return list;
   }
248803
public String getErrorPage(String error)
    {
        if (_errorPages == null)
            return null;
        return (String)_errorPages.get(error);
    }
498278
private void showErrorPage(HttpServletResponse resp, String message) throws IOException {
		resp.setStatus(HttpServletResponse.SC_OK);
		resp.setContentType(GUIServletStub.CONTENT_TYPE_HTML);

		PrintWriter writer = resp.getWriter();

		writer
			.println("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
		writer.println("<html>");
		writer.println("<head>");
		writer.println("  <title>Launch Job - Error</title>");
		writer.println("  <meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />");
		writer.println("  <link rel=\"stylesheet\" type=\"text/css\" href=\"css/nephelefrontend.css\" />");
		writer.println("</head>");

		writer.println("<body>");
		writer.println("  <div class=\"mainHeading\">");
		writer
			.println("    <h1><img src=\"img/StratosphereLogo.png\" width=\"326\" height=\"100\" alt=\"Stratosphere Logo\" align=\"middle\"/>Nephele and PACTs Query Interface</h1>");
		writer.println("  </div>");
		writer.println("  <div style=\"margin-top: 50px; text-align: center;\">");
		writer.println("    <p class=\"error_text\" style=\"font-size: 18px;\">");
		writer.println(message);
		writer.println("    </p><br/><br/>");
		writer.println("    <form action=\"launch.html\" method=\"GET\">");
		writer.println("      <input type=\"submit\" value=\"back\">");
		writer.println("    </form>");
		writer.println("  </div>");
		writer.println("</body>");
		writer.println("</html>");
	}
145039
public static String getLineNumberFromExceptionTraceLine(String exceptionTraceLine,
                                                             String substrToSearch) {
        String lineNumber = "";
        int index = exceptionTraceLine.indexOf(substrToSearch);
        if (index >= 0) {
            int length = substrToSearch.length() + index;
            if (exceptionTraceLine.lastIndexOf(')') > length) {
                lineNumber = exceptionTraceLine
                    .substring(length, exceptionTraceLine.lastIndexOf(')'));
            }
        }
        return lineNumber;
    }
124011
@com.fasterxml.jackson.annotation.JsonProperty("ErrorDetails")
    public java.util.List<ErrorDetail> getErrorDetails() {
        return errorDetails;
    }
672306
@SuppressWarnings("rawtypes")  
  public Class getException(ClassLoader warClassLoader) {
    try {
      return Class.forName(errorParam, true, warClassLoader);
    } catch (Exception e) {
      return null;
    }
  }
864869
public List getErrors() {
		if (hasChilds()) {
			List ret = new ArrayList(0);
			Iterator it = getChilds().iterator();
			while (it.hasNext()) {
				ret.addAll(((AbcNode) it.next()).getErrors());
			}
			return ret;
		} else {
			return errors != null ? errors : new ArrayList(0);
		}
	}
282494
private Configuration getErrorPageConfiguration() {
		return new AbstractConfiguration() {

			@Override
			public void configure(WebAppContext context) throws Exception {
				ErrorHandler errorHandler = context.getErrorHandler();
				context.setErrorHandler(new JettyEmbeddedErrorHandler(errorHandler));
				addJettyErrorPages(errorHandler, getErrorPages());
			}

		};
	}
408834
private Integer getHttpStatusCode(ErrorMap error, Shape shape) {
        final Integer httpStatusCode = getHttpStatusCode(error.getErrorTrait());
        return httpStatusCode == null ? getHttpStatusCode(shape.getErrorTrait()) : httpStatusCode;
    }