private void handleRuntimeException(String expr, Object value, boolean throwExceptionOnFailure, RuntimeException re) { if (throwExceptionOnFailure) { String message = ErrorMessageBuilder.create() .errorSettingExpressionWithValue(expr, value) .build(); throw new XWorkException(message, re); } else { if (LOG.isWarnEnabled()) { LOG.warn("Error setting value [#0] with expression [#1]", re, value.toString(), expr); } } }
private void handleOgnlException(String expr, Object value, boolean throwExceptionOnFailure, OgnlException e) { boolean shouldLog = shouldLogMissingPropertyWarning(e); String msg = null; if (throwExceptionOnFailure || shouldLog) { msg = ErrorMessageBuilder.create() .errorSettingExpressionWithValue(expr, value) .build(); } if (shouldLog) { LOG.warn(msg, e); } if (throwExceptionOnFailure) { throw new XWorkException(msg, e); } }