From d047feba9a1f136f4b066f417c9e403efb8d2901 Mon Sep 17 00:00:00 2001 From: Codemonkey51 <62217716+Codemonkey51@users.noreply.github.com> Date: Fri, 9 Oct 2020 14:36:06 -0700 Subject: [PATCH] Db Async delete 404 keyerror Make async delete raise key error if it runs into a non-existent key --- src/replit/database/database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/replit/database/database.py b/src/replit/database/database.py index 00d5d7c..b17d596 100644 --- a/src/replit/database/database.py +++ b/src/replit/database/database.py @@ -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, ...]: