Db Async delete 404 keyerror

Make async delete raise key error if it runs into a non-existent key
This commit is contained in:
Codemonkey51
2020-10-09 14:36:06 -07:00
committed by GitHub
parent c4284478f4
commit d047feba9a
+2
View File
@@ -63,6 +63,8 @@ class AsyncDatabase:
async with session.delete(
self.db_url + "/" + urllib.parse.quote(key)
) as response:
if(response.status_code==404):
raise KeyError(key)
response.raise_for_status()
async def list(self, prefix: str) -> Tuple[str, ...]: