From fe2c1f29fa86a0ec18a753132aa6218f26a8167c Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Thu, 22 Sep 2022 08:01:10 -0400 Subject: [PATCH] Agent: Catch requests.JSONDecodeError --- .../island_api_client/http_island_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/island_api_client/http_island_api_client.py b/monkey/infection_monkey/island_api_client/http_island_api_client.py index d34a4ac6f..227c700e9 100644 --- a/monkey/infection_monkey/island_api_client/http_island_api_client.py +++ b/monkey/infection_monkey/island_api_client/http_island_api_client.py @@ -61,7 +61,7 @@ def convert_json_error_to_island_api_error(fn): def wrapper(*args, **kwargs): try: return fn(*args, **kwargs) - except json.JSONDecodeError as err: + except (requests.JSONDecodeError, json.JSONDecodeError) as err: raise IslandAPIRequestFailedError(err) return wrapper