From 9dabaeeb9672066467b04aa630e0a62d44615e49 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Thu, 27 Sep 2012 02:33:01 +0000 Subject: [PATCH] Show where the parsing failed git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1390814 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/commons/lang3/time/FastDateParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java index 9f1850e4d..12f99c70e 100644 --- a/src/main/java/org/apache/commons/lang3/time/FastDateParser.java +++ b/src/main/java/org/apache/commons/lang3/time/FastDateParser.java @@ -122,7 +122,8 @@ public class FastDateParser implements DateParser, Serializable { Matcher patternMatcher= formatPattern.matcher(pattern); if(!patternMatcher.lookingAt()) { - throw new IllegalArgumentException("Invalid pattern"); + throw new IllegalArgumentException( + "Illegal pattern character '" + pattern.charAt(patternMatcher.regionStart()) + "'"); } currentFormatField= patternMatcher.group();