fix: show exception when connection error

This commit is contained in:
Achille Myette 2025-01-30 17:53:34 +00:00
parent 1673f7bb59
commit 94c7022054

View File

@ -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: