From 0b0f0394743059676875ce967857979a97df1769 Mon Sep 17 00:00:00 2001 From: vakarisz Date: Fri, 16 Sep 2022 17:39:46 +0300 Subject: [PATCH] Agent: Add 4 IslandAPIErrors --- .../transport/island_api_client_errors.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 monkey/infection_monkey/transport/island_api_client_errors.py diff --git a/monkey/infection_monkey/transport/island_api_client_errors.py b/monkey/infection_monkey/transport/island_api_client_errors.py new file mode 100644 index 000000000..d0dbeb0c4 --- /dev/null +++ b/monkey/infection_monkey/transport/island_api_client_errors.py @@ -0,0 +1,30 @@ +class IslandAPIError(Exception): + """ + Raised when something goes wrong when calling the Island API + """ + + pass + + +class IslandAPITimeoutError(IslandAPIError): + """ + Raised when the API request hits a timeout + """ + + pass + + +class IslandAPIConnectionError(IslandAPIError): + """ + Raised when the API request can't find/connect to the Island + """ + + pass + + +class IslandAPIRequestFailedError(IslandAPIError): + """ + Raised when the API request fails(malformed request or an error on the API side) + """ + + pass