Skip to content

Commit

Permalink
[supybot] Include filepath data on ParseError exception
Browse files Browse the repository at this point in the history
When ParseError is raided by parse_supybot_log(), the filepath
to the archive that caused the exception will be included
in the exception message.

Fixes #135

Backend updated to version 0.5.1.
  • Loading branch information
sduenas committed Apr 6, 2017
1 parent ee954d6 commit ccc317c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions perceval/backends/core/supybot.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Supybot(Backend):
:param tag: label used to mark the data
:param cache: cache object to store raw data
"""
version = '0.5.0'
version = '0.5.1'

def __init__(self, uri, dirpath, tag=None, cache=None):
origin = uri
Expand Down Expand Up @@ -228,8 +228,12 @@ def parse_supybot_log(filepath):
newline=os.linesep) as f:
parser = SupybotParser(f)

for message in parser.parse():
yield message
try:
for message in parser.parse():
yield message
except ParseError as e:
cause = "file: %s; reason: %s" % (filepath, str(e))
raise ParseError(cause=cause)


class SupybotCommand(BackendCommand):
Expand Down

0 comments on commit ccc317c

Please sign in to comment.