From 42498bba93a54e96070e976da2415c10b713e38b Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 7 Mar 2019 05:25:06 +0200 Subject: [PATCH] parseLedgerDate: more info on parse error --- app/src/main/java/net/ktnx/mobileledger/utils/Globals.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.39.5