diff options
Diffstat (limited to 'ick2/persistent.py')
-rw-r--r-- | ick2/persistent.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ick2/persistent.py b/ick2/persistent.py index 4b216b3..535bdc0 100644 --- a/ick2/persistent.py +++ b/ick2/persistent.py @@ -95,7 +95,7 @@ class FilePersistentState(PersistentStateInterface): def get_resource(self, kind, rid): filename = self._filename(kind, rid) if not os.path.exists(filename): - raise ick2.NotFound() + raise ick2.NotFound(kind=kind, rid=rid) with open(filename, 'r') as f: as_dict = yaml.safe_load(f) return resource_from_dict(as_dict) @@ -116,8 +116,10 @@ class FilePersistentState(PersistentStateInterface): class NotFound(Exception): - def __init__(self): - super().__init__('Resource not found') + def __init__(self, kind=None, rid=None): + super().__init__( + 'Resource {}:{} not found'.format( + kind or "unknown", rid or "unknown")) class Resource: # pragma: no cover |