Skip to content

Commit

Permalink
fixup when no content is matched between start and end
Browse files Browse the repository at this point in the history
  • Loading branch information
bosd committed Sep 25, 2022
1 parent ad6ee6d commit 436ade8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/invoice2data/extract/parsers/lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ def parse(template, field, _settings, content):
# Strip the content down to the items between start and end tag of this setting
start = re.search(setting["start"], content)
end = re.search(setting["end"], content)
if not start or not end:
logger.warning(f"No content found between:\n Start match: {start}.\n End match: {end}")
continue

content_of_setting = content[start.end() : end.start()]

# search if the current line is in the content.
Expand Down

0 comments on commit 436ade8

Please sign in to comment.