Skip to content

Commit e607c2e

Browse files
committed
Add try-except-block for debugging
1 parent cd996e3 commit e607c2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

ledgertools/read.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def _parse_header(self, string):
8484
return None
8585

8686
def _parse_posting(self, string):
87-
parts = [p for p in string.split(' ') if p]
87+
parts = [p.strip() for p in string.split(' ') if p]
8888

8989
account = parts[0]
9090
try:
@@ -100,8 +100,12 @@ def _parse_posting(self, string):
100100
# check for posting date
101101
secondary_date = None
102102
if 'date' in tags.keys():
103-
secondary_date = pendulum.parse(tags['date']).date()
104-
del tags['date']
103+
try:
104+
secondary_date = pendulum.parse(tags['date']).date()
105+
del tags['date']
106+
except:
107+
print(parts)
108+
raise
105109
return dict(account=account,
106110
amount=amount,
107111
tags=tags,

0 commit comments

Comments
 (0)