import2ledger/import2ledger/errors.py
Brett Smith cc8da9392e errors: Add UserInputError.__str__.
This makes messages look nicer in logs.
2017-10-26 12:04:44 -04:00

18 lines
495 B
Python

class UserInputError(Exception):
def __init__(self, strerror, user_input):
super().__init__(strerror, user_input)
self.strerror = strerror
self.user_input = user_input
def __str__(self):
return "{}: {}".format(self.strerror, self.user_input)
class UserInputConfigurationError(UserInputError):
pass
class UserInputFileError(UserInputError):
def __init__(self, strerror, path):
super().__init__(strerror, path)
self.path = path