From 36eb7ac25c14a7a6a3553f03bcfc76358b577993 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 9 Jul 2018 18:42:52 +0300 Subject: Change: give NotMuch its optional args everywhere --- ick2/apibase.py | 4 ++-- ick2/trans.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ick2') diff --git a/ick2/apibase.py b/ick2/apibase.py index aeda00b..9e3eaff 100644 --- a/ick2/apibase.py +++ b/ick2/apibase.py @@ -173,7 +173,7 @@ class ResourceApiBase(APIbase): def update(self, body, name, **kwargs): rid = self.get_resource_name(body) if not self._trans.has_resource(self._type_name, rid): - raise ick2.NotFound() + raise ick2.NotFound(kind=self._type_name, rid=rid) with self._trans.modify(self._type_name, rid) as resource: as_dict = self.mangle_updated_resource(resource.as_dict(), body) @@ -186,5 +186,5 @@ class ResourceApiBase(APIbase): def delete(self, name, **kwargs): if not self._trans.has_resource(self._type_name, name): - raise ick2.NotFound() + raise ick2.NotFound(kind=self._type_name, rid=name) self._trans.remove_resource(self._type_name, name) diff --git a/ick2/trans.py b/ick2/trans.py index c648916..f1c8e5e 100644 --- a/ick2/trans.py +++ b/ick2/trans.py @@ -56,7 +56,7 @@ class TransactionalState: def modify(self, kind, rid): if not self.state.has_resource(kind, rid): - raise ick2.NotFound() + raise ick2.NotFound(kind=kind, rid=rid) return TransactionalResource(self.state, kind, rid) def get_resource_kinds(self): -- cgit v1.2.1