diff --git a/conservancy_beancount/plugin/errors.py b/conservancy_beancount/plugin/errors.py index 59b8525..6bd6842 100644 --- a/conservancy_beancount/plugin/errors.py +++ b/conservancy_beancount/plugin/errors.py @@ -20,6 +20,13 @@ class _BaseError(Exception): self.entry = entry self.source = entry.meta if source is None else source + def __repr__(self): + return "{clsname}<{source[filename]}:{source[lineno]}: {message}>".format( + clsname=type(self).__name__, + message=self.message, + source=self.source, + ) + class InvalidMetadataError(_BaseError): def __init__(self, txn, post, key, value=None, source=None):