From 23a09d8ad0c2973c21d63738815ed0d7616588e5 Mon Sep 17 00:00:00 2001 From: Kunal Jha Date: Thu, 22 Nov 2018 12:45:38 +0100 Subject: [PATCH 1/2] fixed the validation logging message --- .../java/org/zalando/nakadi/validation/MetadataValidator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java b/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java index 467c714738..15e6188aae 100644 --- a/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java +++ b/src/main/java/org/zalando/nakadi/validation/MetadataValidator.java @@ -17,6 +17,7 @@ public Optional accepts(final JSONObject event) { } private Optional checkDateTime(final String occurredAt) { - return validator.validate(occurredAt).map(ValidationError::new); + return validator.validate(occurredAt) + .map(e-> new ValidationError("#/metadata/occurred_at:" + e)); } } From 603d0f0a68807c9059e838c8321681d851407eac Mon Sep 17 00:00:00 2001 From: Kunal Jha Date: Fri, 23 Nov 2018 13:55:23 +0100 Subject: [PATCH 2/2] added error message in case of DateTimeexception --- .../org/zalando/nakadi/validation/RFC3339DateTimeValidator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java b/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java index d7fb692d35..d6ceb8f16f 100644 --- a/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java +++ b/src/main/java/org/zalando/nakadi/validation/RFC3339DateTimeValidator.java @@ -35,7 +35,7 @@ public Optional validate(final String dateTime) { } } catch (final DateTimeParseException e) { - return error; + return Optional.of(error.get() + " " + e.getMessage()); } } }