You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
488 B

class FileParseException(Exception):
def __init__(self, filename: str, line_num: int, message: str):
self.filename = filename
self.line_num = line_num
self.message = message
def __str__(self):
return f'ParseError: You cannot parse line {self.line_num} in {self.filename}: {self.message}'
def dict(self):
return {
'filename': self.filename,
'line': self.line_num,
'message': self.message
}