This method creates the {@link NlsMessage} wrapping the given {@code errors}.

@param errors are the {@link Throwable errors} that have been collected.
@return the combined {@link NlsMessage}.
540221
private static NlsMessage createSubMessage(Object[] errors) {

    Object[] messages = new Object[errors.length];
    for (int i = 0; i < messages.length; i++) {
      if (errors[i] == null) {
        messages[i] = null;
      } else if (errors[i] instanceof NlsObject) {
        messages[i] = ((NlsObject) errors[i]).toNlsMessage();
      } else if (errors[i] instanceof Throwable) {
        messages[i] = ((Throwable) errors[i]).getLocalizedMessage();
      } else {
        messages[i] = errors[i];
      }
    }
    return new ComposedNlsMessage(messages);
  }
1284292
public static ErrorItem toErrorItem(final String logMessage, final Throwable t) {
		
		// get a flat list of the throwable and the causal chain
		
		List<Throwable> throwables = Throwables.getCausalChain(t);

		// create and populate builders for all throwables
		
		List<ErrorItem.Builder> builders = new ArrayList<ErrorItem.Builder>(throwables.size());
		
		for (int i = 0; i < throwables.size(); ++i) {
			if (i == 0) {
				ErrorItem.Builder builder = toErrorItemBuilderWithoutCause(logMessage, throwables.get(i));
				builders.add(builder);
			} else {
				ErrorItem.Builder builder = toErrorItemBuilderWithoutCause(null, throwables.get(i));
				builders.add(builder);
			}
		}
		
		// attach child errors to their parent in reverse order
		
		for (int i = builders.size() - 1; 0 < i; --i) {
			ErrorItem.Builder parent = builders.get(i - 1);
			ErrorItem.Builder child = builders.get(i);
			
			parent.innerError(child.build());
		}
		
		// return the assembled original error
		
		return builders.get(0).build();
	}
145037
public List getErrorMessages() {
	             List messages = new ArrayList();
	         for ( Iterator errorIter = errors.iterator() ; errorIter.hasNext() ; ) {
	                      messages.add( createErrorMessage( (RecognitionException) errorIter.next() ) );
	                  }
	                  return messages;
	         }
725979
function (errors) {
    if (typeof errors === 'string' || errors instanceof Error) {
      errors = {'*': '' + errors};
    }
    else if (errors == null) {
      errors = {'*': 'Unknown error'};
    }
    return new DS.InvalidError(errors);
  }
1324312
public void setErrors(java.util.Collection<SnapshotErrorMessage> errors) {
        if (errors == null) {
            this.errors = null;
            return;
        }

        this.errors = new com.amazonaws.internal.SdkInternalList<SnapshotErrorMessage>(errors);
    }
174352
@Override
	public void onCommunicationException(Throwable error) {
		addMessage(MESSAGES.commandCommunicationError() + error.getMessage(), ERRORMESSAGE_STYLE);
	}
505131
public static Result failure(int code, String message, List<Error> errors) {
        return new Result(code, message, errors);
    }
168919
public void error( String msg, Throwable t )
    {
        if( m_delegate.isErrorEnabled() )
        {
            m_delegate.error( msg, t );
        }
    }
229341
@CheckReturnValue
  public ErrorProneFlags plus(ErrorProneFlags other) {
    Map<String, String> combinedMaps = new HashMap<>(this.getFlagsMap());
    combinedMaps.putAll(other.getFlagsMap());
    return ErrorProneFlags.fromMap(combinedMaps);
  }
151697
private String createErrorMsg(JspLineId jspLineId, int errorLineNr) {
        StringBuffer compilerOutput = new StringBuffer();

        if (jspLineId.getSourceLineCount() <= 1) {
			Object[] objArray = new Object[] { new Integer(jspLineId.getStartSourceLineNum()), jspLineId.getFilePath()};
			if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
				compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number", objArray));  // Defect 211450
			}
			else {
				compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));  // Defect 211450
			}
        }
        else {
			// compute exact JSP line number 
			int actualLineNum=jspLineId.getStartSourceLineNum()+(errorLineNr-jspLineId.getStartGeneratedLineNum());
			if (actualLineNum>=jspLineId.getStartSourceLineNum() && actualLineNum <=(jspLineId.getStartSourceLineNum() + jspLineId.getSourceLineCount() - 1)) {
				Object[] objArray = new Object[] { new Integer(actualLineNum), jspLineId.getFilePath()};
				if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
					compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number", objArray));  // Defect 211450
				}
				else {
					compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.single.line.number.included.file", objArray));  // Defect 211450
				}
			}
			else {
				Object[] objArray = new Object[] {
					new Integer(jspLineId.getStartSourceLineNum()),
					new Integer((jspLineId.getStartSourceLineNum()) + jspLineId.getSourceLineCount() - 1),
					jspLineId.getFilePath()};
				if (jspLineId.getFilePath().equals(jspLineId.getParentFile())) {
					compilerOutput.append(separatorString+  // Defect 211450
						JspCoreException.getMsg(
							"jsp.error.multiple.line.number", objArray));
				}
				else {
					compilerOutput.append(separatorString+  // Defect 211450
						JspCoreException.getMsg(
							"jsp.error.multiple.line.number.included.file",objArray));
				}
			}
        }

		compilerOutput.append(separatorString+JspCoreException.getMsg("jsp.error.corresponding.servlet",new Object[] { jspLineId.getParentFile()}));  // Defect 211450
		    //152470 starts
	        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable(Level.FINER)) {
	            logger.logp(Level.FINER, CLASS_NAME, "createErrorMsg", "The value of the JSP attribute jdkSourceLevel is ["+ jdkSourceLevel +"]");
	        }
	        //152470 ends
        return compilerOutput.toString();
    }
349464
public void addErrorMsgs(final Set<String> msgs) {
    if (msgs != null) {
      this._errorMsgs.addAll(msgs);
      if (!msgs.isEmpty()) {
        this._status = ValidationStatus.ERROR;
      }
    }
  }
1159489
public String getErrorMessagesString() {

        StringBuffer errors = new StringBuffer(8);
        Iterator<String> i = getErrorMessages().iterator();
        while (i.hasNext()) {
            errors.append(i.next());
            if (i.hasNext()) {
                errors.append("<br>");
            }
        }
        return errors.toString();
    }
653729
public void showErrors(final Set<String> messages) {
    final InputElement inputElement = this.getInputElement();
    if (messages.isEmpty()) {
      if (FeatureCheck.supportCustomValidity(inputElement)) {
        inputElement.setCustomValidity(StringUtils.EMPTY);
      }
      if (this.validationMessageElement == null) {
        inputElement.setTitle(StringUtils.EMPTY);
      } else {
        this.validationMessageElement.getElement().removeAllChildren();
      }
    } else {
      final String messagesAsString = ErrorMessageFormater.messagesToString(messages);
      if (FeatureCheck.supportCustomValidity(inputElement)) {
        inputElement.setCustomValidity(messagesAsString);
      }
      if (this.validationMessageElement == null) {
        inputElement.setTitle(messagesAsString);
      } else {
        this.validationMessageElement.getElement()
            .setInnerSafeHtml(ErrorMessageFormater.messagesToList(messages));
      }
    }
  }
290814
private static JavaScriptObject[] toNativeErrorArray(List<JSError> errors) {
    JavaScriptObject[] out = new JavaScriptObject[errors.size()];
    for (int i = 0; i < errors.size(); ++i) {
      JSError error = errors.get(i);
      DiagnosticType type = error.getType();
      out[i] = createError(error.sourceName, error.description, type != null ? type.key : null,
          error.lineNumber, error.getCharno());
    }
    return out;
  }
1108906
protected String composeError(Exception error) {
		StringBuilder builder = new StringBuilder();

		while (error != null) {
			if (builder.length() > 0)
				builder.append(" Caused by error: ");

			builder.append(error.getMessage()).append(" StackTrace: ").append(error.getStackTrace());

			try {
				error = error.getClass().newInstance();///// ????
			} catch (InstantiationException | IllegalAccessException e) {
				e.printStackTrace();
			}
		}

		return builder.toString();
	}
927564
function Error(message) {
  var error = new OriginalError(message)
  addNonEnumerableValue(error, '__trycatchcurrentStack__', trycatch.currentStack)
  return error
}
541535
private String createError(String errorMsg, Throwable t) {

        StringBuffer msg = new StringBuffer();
        msg.append(errorMsg);
        msg.append("\n");
        msg.append(t.getMessage());
        msg.append("\n");
        msg.append(CmsException.getStackTraceAsString(t));

        return createError(msg.toString());
    }