From bd810440aff50660161391998d8f36eaa6384302 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 7 Jul 2022 12:53:13 -0400 Subject: [PATCH] Island: Remove unnecessary error handling Flask automatically catches exceptions and returns a 500 response, so there's no need to add extra code to do this. --- .../monkey_island/cc/resources/clear_simulation_data.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/monkey/monkey_island/cc/resources/clear_simulation_data.py b/monkey/monkey_island/cc/resources/clear_simulation_data.py index dc0d868b0..e04060987 100644 --- a/monkey/monkey_island/cc/resources/clear_simulation_data.py +++ b/monkey/monkey_island/cc/resources/clear_simulation_data.py @@ -19,12 +19,6 @@ class ClearSimulationData(AbstractResource): Clear all data collected during the simulation """ Database.reset_db(reset_config=False) - - try: - self._credentials_repository.remove_stolen_credentials() - except RemovalError as err: - make_response( - {"error": f"Error encountered while removing stolen credentials: {err}"}, 500 - ) + self._credentials_repository.remove_stolen_credentials() return make_response({}, 200)