Repository: incubator-nifi
Updated Branches:
  refs/heads/develop 7e70fd53e -> d8b4a781d


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


Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/d8b4a781
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/d8b4a781
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/d8b4a781

Branch: refs/heads/develop
Commit: d8b4a781d2b1ced7deb42b19b41bf6c3c463f623
Parents: 7e70fd5
Author: joewitt <joew...@apache.org>
Authored: Tue Jan 6 09:23:19 2015 -0500
Committer: joewitt <joew...@apache.org>
Committed: Tue Jan 6 09:23:19 2015 -0500

----------------------------------------------------------------------
 .../expression/language/evaluation/cast/DateCastEvaluator.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/d8b4a781/commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/cast/DateCastEvaluator.java
----------------------------------------------------------------------
diff --git 
a/commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/cast/DateCastEvaluator.java
 
b/commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/cast/DateCastEvaluator.java
index b6d758c..2a18240 100644
--- 
a/commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/cast/DateCastEvaluator.java
+++ 
b/commons/nifi-expression-language/src/main/java/org/apache/nifi/attribute/expression/language/evaluation/cast/DateCastEvaluator.java
@@ -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)));

Reply via email to