From db78ce2c1442ab0385485b4d31ed991737373d91 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Tue, 31 Jan 2023 12:53:08 +0100 Subject: [PATCH] Change exception types and messages --- src/argus_ticket_rt.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/argus_ticket_rt.py b/src/argus_ticket_rt.py index 73b253e..91f27b7 100644 --- a/src/argus_ticket_rt.py +++ b/src/argus_ticket_rt.py @@ -83,8 +83,9 @@ def create_client(endpoint, authentication): token=authentication["token"], ) except Exception as e: - LOG.exception("Request Tracker: Client could not be created.") - raise TicketPluginException(f"Request Tracker: {e}") + client_error = "Request Tracker: Client could not be created." + LOG.exception(client_error) + raise TicketClientException(client_error) else: return client @@ -96,8 +97,9 @@ def create_client(endpoint, authentication): ), ) except Exception as e: - LOG.exception("Request Tracker: Client could not be created.") - raise TicketPluginException(f"Request Tracker: {e}") + client_error = "Request Tracker: Client could not be created." + LOG.exception(client_error) + raise TicketClientException(client_error) else: return client