Show where the parsing failed

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1390814 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-09-27 02:33:01 +00:00
parent f899c178b7
commit 9dabaeeb96
1 changed files with 2 additions and 1 deletions

View File

@ -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();