assert -> Exception

This commit is contained in:
meejah 2020-06-30 08:17:34 -06:00
parent a9f4210014
commit 80359e02e6

View File

@ -162,7 +162,10 @@ class _FakeTahoeUriHandler(Resource, object):
return (False, k)
cap = self._generate_capability(kind)
assert cap not in self.data, "logic error" # shouldn't happen
# it should be impossible for this to already be in our data,
# but check anyway to be sure
if cap in self.data:
raise Exception("Internal error; key already exists somehow")
self.data[cap] = data
return (True, cap)