From: Damyan Ivanov Date: Thu, 7 Mar 2019 03:25:06 +0000 (+0200) Subject: parseLedgerDate: more info on parse error X-Git-Tag: v0.8~41 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=42498bba93a54e96070e976da2415c10b713e38b;p=mobile-ledger.git parseLedgerDate: more info on parse error --- diff --git a/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java b/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java index 4562dbae..8f010cbe 100644 --- a/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java +++ b/app/src/main/java/net/ktnx/mobileledger/utils/Globals.java @@ -53,7 +53,9 @@ public final class Globals { } public static Date parseLedgerDate(String dateString) throws ParseException { Matcher m = reLedgerDate.matcher(dateString); - if (!m.matches()) throw new ParseException(dateString, 0); + if (!m.matches()) throw new ParseException( + String.format("'%s' does not match expected pattern '%s'", dateString, + reLedgerDate.toString()), 0); String year = m.group(1); String month = m.group(2);