Constructs a JbcSrcJavaValue that represents an error.
764950
static JbcSrcJavaValue error(Expression expr, JbcSrcValueErrorReporter reporter) {
    return new JbcSrcJavaValue(
        expr,
        /* method= */ null,
        /* allowedType= */ null,
        /* constantNull= */ false,
        /* error= */ true,
        reporter);
  }
1030098
private Throwable readError(ByteBuf buffer) {
    return context.serializer().readObject(INPUT.get().setByteBuf(buffer));
  }
62443
@Nonnull
    public static <T> T checkNotNull(T value, @Nonnull String errorMessage) {
        if (value == null) {
            throw new NullPointerException(errorMessage);
        }
        return value;
    }
895947
private void validateMessageForNull(Message msg) throws MessageFormatException {

        // if the supplied message is null, throw a jms MessageFormatException.
        if (msg == null) {
            throw (MessageFormatException) JmsErrorUtils.newThrowable(
                                                                      MessageFormatException.class,
                                                                      "INVALID_VALUE_CWSIA0068",
                                                                      new Object[] { "message", null },
                                                                      tc);
        }
    }
452813
static JbcSrcJavaValue of(Expression expr, Method method, JbcSrcValueErrorReporter reporter) {
    checkNotNull(method);
    if (expr instanceof SoyExpression) {
      return new JbcSrcJavaValue(
          expr,
          method,
          /* allowedType= */ ((SoyExpression) expr).soyType(),
          /* constantNull= */ false,
          /* error= */ false,
          reporter);
    }
    return new JbcSrcJavaValue(
        expr,
        method,
        /* allowedType= */ null,
        /* constantNull= */ false,
        /* error= */ false,
        reporter);
  }
947160
static void validateHeaderValue(CharSequence value) {
        if (value == null) {
            throw new NullPointerException("value");
        }
        for (int i = 0; i < value.length(); i ++) {
            char c = value.charAt(i);
            if (c == 0) {
                throw new IllegalArgumentException(
                        "value contains null character: " + value);
            }
        }
    }
560770
private AssertionError createAssertionError() {
		// convert both sides to strings
		String expected = TreeQuery.toString(expectedDef, expectedRoot, expectedToString);
		String actual = TreeQuery.toString(actualDef, actualRoot, actualToString);
		// try to create a junit ComparisonFailure
		for (String exceptionType : Arrays.asList(
				"org.junit.ComparisonFailure",
				"junit.framework.ComparisonFailure")) {
			try {
				return createComparisonFailure(exceptionType, expected, actual);
			} catch (Exception e) {}
		}
		// we'll have to settle for a plain-jane AssertionError
		return new AssertionError("Expected:\n" + expected + "\n\nActual:\n" + actual);
	}
22792
def getTypedValueNoExceptions(self, row):
        ''''''
        return wrapply(self.type, wrapply(self.getValue, row))
1320471
function makeError(jqXHR, textStatus, errorThrown, options) {
    var Constructor = statusToError[textStatus];

    // We did not find anything in the map, which would happen if the textStatus
    // was "error". Determine whether an ``HttpError`` or an ``AjaxError`` must
    // be thrown.
    if (!Constructor) {
      Constructor = statusToError[(jqXHR.status !== 0) ? "http" : "ajax"];
    }

    return new Constructor(jqXHR, textStatus, errorThrown, options);
  }
269117
private CellFormatResult getErrorCellValue(final byte errorValue, final Locale locale) {

       final FormulaError error = FormulaError.forInt(errorValue);
       final CellFormatResult result = new CellFormatResult();
       result.setCellType(FormatCellType.Error);
       result.setValue(error.getCode());

       if(isErrorCellAsEmpty()) {
           result.setText("");
       } else {
           result.setText(error.getString());
       }

       return result;

    }
305989
@Override
    public void validateDefault(InputProblemReporter rep, boolean normalize)
        throws XMLStreamException
    {
        String defValue = mDefValue.getValue();
        int len = defValue.length();

        // Then code similar to actual value validation:
        StringBuilder sb = null;
        int count = 0;
        int start = 0;

        main_loop:
        while (start < len) {
            char c = defValue.charAt(start);

            // Ok, any white space to skip?
            while (true) {
                if (!WstxInputData.isSpaceChar(c)) {
                    break;
                }
                if (++start >= len) {
                    break main_loop;
                }
                c = defValue.charAt(start);
            }

            int i = start+1;

            do {
                if (++i >= len) {
                    break;
                }
                c = defValue.charAt(i);
            } while (!WstxInputData.isSpaceChar(c));
            ++count;
            String token = defValue.substring(start, i);
            int illegalIx = WstxInputData.findIllegalNmtokenChar(token, mCfgNsAware, mCfgXml11);
            if (illegalIx >= 0) {
                reportValidationProblem(rep, "Invalid default value '"+defValue
                                        +"'; character #"+illegalIx+" ("
                                        +WstxInputData.getCharDesc(defValue.charAt(illegalIx))
                                        +") not a valid NMTOKENS character");
            }

            if (normalize) {
                if (sb == null) {
                    sb = new StringBuilder(i - start + 32);
                } else {
                    sb.append(' ');
                }
                sb.append(token);
            }
            start = i+1;
        }

        if (count == 0) {
            reportValidationProblem(rep, "Invalid default value '"+defValue
                                    +"'; empty String is not a valid NMTOKENS value");
            return;
        }

        if (normalize) {
            mDefValue.setValue(sb.toString());
        }
    }
296127
public void rejectValue(final String field, final Class<?> fieldType, final String errorCode, 
            final Map<String, Object> messageVariables) {
        
        rejectValue(field, fieldType, errorCode, messageVariables, null);
        
    }
1313831
private static Object toDatabaseSupportedValue(Object value) {
        if (value instanceof java.lang.String ||
                value instanceof byte[] ||
                value instanceof Byte[] ||
                value instanceof java.lang.Long ||
                value instanceof java.lang.Integer ||
                value instanceof java.lang.Boolean ||
                value instanceof java.math.BigInteger ||
                value instanceof java.lang.Float ||
                value instanceof java.lang.Double ||
                value instanceof java.math.BigDecimal ||
                value instanceof java.sql.Date ||
                value instanceof java.util.Date ||
                /*
                because java.sql.Time and java.sql.Timestamp is subclass of java.sql.Date so the checks always return true
                value instanceof java.sql.Time || value instanceof java.sql.Timestamp ||
                */
                value instanceof java.util.Calendar
                ) {
            return value;
        } else {
            return Reflection.toType(value, String.class);
        }
    }
1218496
protected void handleResponseBeanValidationErrorException(Object bean, Consumer<ExceptionMessageBuilder> locationBuilder,
            UserMessages messages, RuntimeException cause) {
        // cause is completely framework info so not show it
        final String msg = buildValidationErrorMessage(bean, locationBuilder, messages);
        if (warning) {
            logger.warn(msg);
        } else { // but keep framework information for various purpose of client
            throw new ResponseBeanValidationErrorException(msg, bean, messages);
        }
    }
1039684
@Override
	public List<GigJavaProblem> validate(TypeDeclaration declaration,
			IType type, CompilationUnit unit, String file)
			throws JavaModelException {
		List<GigJavaProblem> problems = new ArrayList<GigJavaProblem>();
		int flags = type.getFlags();
		
		if (!Flags.isAbstract(flags)) {
			if (!Flags.isPublic(flags)) {
				GigJavaProblem problem = new GigJavaProblem(
						Severity.ERROR, "Concrete Component class must be public", file);
				ISourceRange range = type.getNameRange();
				int offset = range.getOffset();
				problem.setSourceStart(offset);
				problem.setSourceEnd(offset + range.getLength() - 1);
				problem.setSourceLineNumber(unit.getLineNumber(offset));
				problems.add(problem);
				return problems;
			}
		}
		
		return problems;
	}
656220
protected String composeError(Exception error) {
		StringBuilder builder = new StringBuilder();

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

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

			t = t.getCause();
		}

		return builder.toString();
	}
270126
private void formatAndThrowJSLintError(BundleProcessingStatus status, byte[] bundleBytes, JSMinException e) {
		StringBuilder errorMsg = new StringBuilder(
				"JSMin failed to minify the bundle with id: '" + status.getCurrentBundle().getId() + "'.\n");
		errorMsg.append("The exception thrown is of type:").append(e.getClass().getName()).append("'.\n");
		int currentByte = e.getByteIndex();
		int startPoint;
		if (currentByte < 100)
			startPoint = 0;
		else
			startPoint = currentByte - 100;
		int totalSize = currentByte - startPoint;

		byte[] lastData = new byte[totalSize];

		for (int x = 0; x < totalSize; x++) {
			lastData[x] = bundleBytes[startPoint];
			startPoint++;
		}
		errorMsg.append("The error happened at this point in your javascript (line ").append(e.getLine())
				.append("; col. ").append(e.getColumn()).append(") : \n");
		errorMsg.append("_______________________________________________\n...");
		try {
			String data = byteArrayToString(status.getJawrConfig().getResourceCharset(), lastData).toString();
			errorMsg.append(data).append("\n\n");
		} catch (IOException e1) {
			// Ignored, we have enaugh problems by this point.
		}
		errorMsg.append("_______________________________________________");
		errorMsg.append(
				"\nIf you can't find the error, try to check the scripts using JSLint (http://www.jslint.com/) to find the conflicting part of the code. ");

		throw new BundlingProcessException(errorMsg.toString(), e);
	}