Skip to content

Commit

Permalink
Add ParseError to parser module
Browse files Browse the repository at this point in the history
  • Loading branch information
benne238 committed Jun 28, 2021
1 parent 2648c8e commit 425b41a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/webqueue2api/parser/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ def __init__(self, path: str):
class QueueDoesNotExistError(Exception):
def __init__(self, path: str):
self.message = f"Directory {path} not found."
super().__init__(self.message)

class ParseError(Exception):
def __init__(self, line_number: int, message: str = "Unable to parse item."):
self.message = f"{message} at line {line_number}"
super().__init__(self.message)

0 comments on commit 425b41a

Please sign in to comment.