NIFI-225 updating error handling to provide more context in output for date format parsing

This commit is contained in:
joewitt 2015-01-06 09:23:19 -05:00
parent 7e70fd53e9
commit d8b4a781d2
1 changed files with 2 additions and 1 deletions

View File

@ -72,7 +72,8 @@ public class DateCastEvaluator extends DateEvaluator {
final Date date = sdf.parse(value);
return new DateQueryResult(date);
} catch (final ParseException pe) {
throw new AttributeExpressionLanguageException("Could not parse input as date", pe);
final String details = "Format: '" + DATE_TO_STRING_FORMAT + "' Value: '" + value + "'";
throw new AttributeExpressionLanguageException("Could not parse date using " + details, pe);
}
} else if (NUMBER_PATTERN.matcher(value).matches()) {
return new DateQueryResult(new Date(Long.valueOf(value)));