From 07815eed933d06a42110fbb7e0f77e353c0378a7 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 15 Sep 2022 11:56:58 -0400 Subject: [PATCH] Island: Wrap drop() Exceptions with RemovalError --- .../cc/repository/mongo_credentials_repository.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/repository/mongo_credentials_repository.py b/monkey/monkey_island/cc/repository/mongo_credentials_repository.py index 20f0ca4d7..ab7c9f18b 100644 --- a/monkey/monkey_island/cc/repository/mongo_credentials_repository.py +++ b/monkey/monkey_island/cc/repository/mongo_credentials_repository.py @@ -110,5 +110,5 @@ class MongoCredentialsRepository(ICredentialsRepository): def _remove_credentials_fom_collection(collection): try: collection.drop() - except RemovalError as err: - raise err + except Exception as err: + raise RemovalError(f"Error removing credentials: {err}")