Pretty prints the given parse errors showing their location in the given input buffer.

@param errors      the parse errors
@return the pretty print text
969424
public static String printParseErrors(List<ParseError> errors) {
        checkArgNotNull(errors, "errors");
        StringBuilder sb = new StringBuilder();
        for (ParseError error : errors) {
            if (sb.length() > 0) sb.append("---\n");
            sb.append(printParseError(error));
        }
        return sb.toString();
    }
852999
public static StringBuilder formatErrors( Collection<? extends RoboconfError> errors, Log log ) {

		StringBuilder result = new StringBuilder();
		for( Map.Entry<RoboconfError,String> entry : RoboconfErrorHelpers.formatErrors( errors, null, true ).entrySet()) {
			if( entry.getKey().getErrorCode().getLevel() == ErrorLevel.WARNING )
				log.warn( entry.getValue());
			else
				log.error( entry.getValue());

			result.append( entry.getValue());
			result.append( "\n" );
		}

		return result;
	}
426777
public java.util.List<ValidationError> getValidationErrors() {
        if (validationErrors == null) {
            validationErrors = new com.amazonaws.internal.SdkInternalList<ValidationError>();
        }
        return validationErrors;
    }
1015813
public JavaSrcTextBuffer printLinesWithIndent(final String text) {
    final String[] splitted = text.split("\n", -1);

    for (final String aSplitted : splitted) {
      this.indent().println(aSplitted);
    }

    return this;
  }
531807
public static String getErrorMessage(Reader xml, List errors) {
        BufferedReader reader = null;
        StringBuffer result = new StringBuffer();
        result.append("Your SLD is not valid.\n");
        result.append(
                "Most common problems are: \n(1) no namespaces - use <ows:GetMap>, <sld:Rule>, <ogc:Filter>, <gml:Point>  - the part before the ':' is important\n");
        result.append("(2) capitialization - use '<And>' not '<and>' \n");
        result.append("(3) Order - The order of elements is important \n");
        result.append(
                "(4) Make sure your first tag imports the correct namespaces.  ie. xmlns:sld=\"http://www.opengis.net/sld\" for EVERY NAMESPACE \n");
        result.append("\n");

        try {
            reader = new BufferedReader(xml);

            String line = reader.readLine();
            int linenumber = 1;
            int exceptionNum = 0;

            // check for lineNumber -1 errors  --> invalid XML
            if (errors.size() > 0) {
                SAXParseException sax = (SAXParseException) errors.get(0);

                if (sax.getLineNumber() < 0) {
                    result.append("   INVALID XML: " + sax.getLocalizedMessage() + "\n");
                    result.append(" \n");
                    exceptionNum = 1; // skip ahead (you only ever get one error in this case)
                }
            }

            while (line != null) {
                line = line.replace('\n', ' ');
                line = line.replace('\r', ' ');

                String header = linenumber + ": ";
                result.append(header + line + "\n"); // record the current line

                boolean keep_going = true;

                while (keep_going) {
                    if ((exceptionNum < errors.size())) {
                        SAXParseException sax = (SAXParseException) errors.get(exceptionNum);

                        if (sax.getLineNumber() <= linenumber) {
                            String head = "---------------------".substring(0, header.length() - 1);
                            String body =
                                    "--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------";

                            int colNum = sax.getColumnNumber(); // protect against col 0 problems

                            if (colNum < 1) {
                                colNum = 1;
                            }

                            if (colNum > body.length()) {
                                body =
                                        body + body + body + body + body
                                                + body; // make it longer (not usually required, but
                                // might be for SLD_BODY=... which is all
                                // one line)

                                if (colNum > body.length()) {
                                    colNum = body.length();
                                }
                            }

                            result.append(head + body.substring(0, colNum - 1) + "^\n");
                            result.append(
                                    "       (line "
                                            + sax.getLineNumber()
                                            + ", column "
                                            + sax.getColumnNumber()
                                            + ")"
                                            + sax.getLocalizedMessage()
                                            + "\n");
                            exceptionNum++;
                        } else {
                            keep_going = false; // report later (sax.getLineNumber() > linenumber)
                        }
                    } else {
                        keep_going = false; // no more errors to report
                    }
                }

                line = reader.readLine(); // will be null at eof
                linenumber++;
            }

            for (int t = exceptionNum; t < errors.size(); t++) {
                SAXParseException sax = (SAXParseException) errors.get(t);
                result.append(
                        "       (line "
                                + sax.getLineNumber()
                                + ", column "
                                + sax.getColumnNumber()
                                + ")"
                                + sax.getLocalizedMessage()
                                + "\n");
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (reader != null) {
                    reader.close();
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        return result.toString();
    }
789683
public static SafeHtml formatErrorHtml(String error) {

        String text;
        String cssClass;
        String title = "";

        if (error == null) {
            text = CmsAliasMessages.messageStatusOk();
            cssClass = STATUS_OK;
        } else {
            text = CmsAliasMessages.messageStatusError();
            title = SafeHtmlUtils.htmlEscape(error);
            cssClass = STATUS_ERROR;
        }
        String html = "<div class='" + cssClass + "' title='" + title + "'>" + text + "</div>";
        return SafeHtmlUtils.fromSafeConstant(html);
    }
236164
public void rawError(int pos, String msg) {
        if (nerrors < MaxErrors && shouldReport(currentSourceFile(), pos)) {
            printRawError(pos, msg);
            prompt();
            nerrors++;
        }
        errWriter.flush();
    }
153648
public T error(CharSequence error) {
        if (view!=null && view instanceof TextView) {
            ((TextView) view).setError(error);
        }
        return self();
    }
1243488
protected String getVBSFailedLineErrorMessage(String errorPut)
    {
        String message="";
        if(errorPut!=null)
        {
            String prefix=".vbs(";
            int start=errorPut.indexOf(prefix);
            if(start!=-1)
            {
                start=start+prefix.length();
                int end=errorPut.indexOf(", ",start-1);
                if(end!=-1)
                {
                    String lineNumberStr=errorPut.substring(start,end);
                    if(lineNumberStr.length()>0)
                    {
                        int lineNumber=-1;
                        try
                        {
                            lineNumber=Integer.parseInt(lineNumberStr);
                        }
                        catch(NumberFormatException exception)
                        {
                            //ignore
                        }
                        
                        if(lineNumber>=1)
                        {
                            message=" error found at line "+lineNumber+", ";
                        }
                    }
                }
            }
        }
        
        return message;
    }
579332
public static String format(String heading, Collection<ErrorMessage> errorMessages) {
    @SuppressWarnings("resource")
    Formatter fmt = new Formatter().format(heading).format(":%n%n");
    int index = 1;
    boolean displayCauses = getOnlyCause(errorMessages) == null;

    for (ErrorMessage errorMessage : errorMessages) {
      fmt.format("%s) %s%n", index++, errorMessage.getMessage());

      Throwable cause = errorMessage.getCause();
      if (displayCauses && cause != null) {
        StringWriter writer = new StringWriter();
        cause.printStackTrace(new PrintWriter(writer));
        fmt.format("Caused by: %s", writer.getBuffer());
      }

      fmt.format("%n");
    }

    if (errorMessages.size() == 1)
      fmt.format("1 error");
    else
      fmt.format("%s errors", errorMessages.size());

    return fmt.toString();
  }
768056
public List<String> getMessages() {
        List<String> errorMessages = new ArrayList<>();
        for (ValidationError error : errors) {
            errorMessages.add(error.getMessage());
        }
        return errorMessages;
    }
725068
public void printErrors(PrintWriter out)
	{
		for (VDMError e : getErrors())
		{
			out.println(e.toString());
		}
	}
132981
public static ParseException create(List<ParseError> errors) {
        if (errors.size() == 1) {
            return new ParseException(errors.get(0).getMessage(), errors);
        } else if (errors.size() > 1) {
            return new ParseException(String.format("%d errors occured. First: %s",
                                                    errors.size(),
                                                    errors.get(0).getMessage()), errors);
        } else {
            return new ParseException("An unknown error occured", errors);
        }
    }
1193008
private void printErrors(){
        if (errorLog.isFile()){
            FileReader fileReader;
            try {
                fileReader = new FileReader(errorLog);
                BufferedReader bufferedReader = new BufferedReader(fileReader);
                String currLine;
                while ((currLine = bufferedReader.readLine()) != null){
                    logger.debug(currLine);
                }
                fileReader.close();
            } catch (Exception e) {
                logger.warn("Error printing cmd command errors {} " , e.getMessage());
                logger.debug("Error: {}", e.getStackTrace());
            } finally {
                try {
                    FileUtils.forceDelete(errorLog);
                } catch (IOException e) {
                    logger.warn("Error closing cmd command errors file {} " , e.getMessage());
                    logger.debug("Error: {}", e.getStackTrace());
                }
            }
        }
    }
583879
public List<ValidationError> validateInput() {
        List<ValidationError> errors = new ArrayList<>();
        Object value = getModel().getValue(getName());
        ValidationError error;
        for (InputValidator validator : validators) {
            error = validator.validate(value, getName(), getLabel());
            if (error != null){
                errors.add(error);
            }
        }
        return errors;
    }
1244335
public static SettingsErrors get(Map<String, String[]> clArgs)
    {
        String[] params = clArgs.remove("-errors");
        if (params == null)
            return new SettingsErrors(new Options());

        GroupedOptions options = GroupedOptions.select(params, new Options());
        if (options == null)
        {
            printHelp();
            System.out.println("Invalid -errors options provided, see output for valid options");
            System.exit(1);
        }
        return new SettingsErrors((Options) options);
    }
145037
public List getErrorMessages() {
	             List messages = new ArrayList();
	         for ( Iterator errorIter = errors.iterator() ; errorIter.hasNext() ; ) {
	                      messages.add( createErrorMessage( (RecognitionException) errorIter.next() ) );
	                  }
	                  return messages;
	         }