From 94c70220548f33b78ab4ed7c24fee5aad1965f02 Mon Sep 17 00:00:00 2001 From: Achille Myette Date: Thu, 30 Jan 2025 17:53:34 +0000 Subject: [PATCH] fix: show exception when connection error --- netbox_zabbix_sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox_zabbix_sync.py b/netbox_zabbix_sync.py index 935b55e..02c92c2 100755 --- a/netbox_zabbix_sync.py +++ b/netbox_zabbix_sync.py @@ -90,8 +90,9 @@ def main(arguments): try: device_cfs = list(netbox.extras.custom_fields.filter( type="text", content_type_id=23)) - except RequestsConnectionError: + except RequestsConnectionError as e: logger.error(f"Unable to connect to NetBox with URL {netbox_host}." + f" Error is: {e}" " Please check the URL and status of NetBox.") sys.exit(1) except NBRequestError as e: