-
Notifications
You must be signed in to change notification settings - Fork 113
Closed
Description
The quick way to test it is with no Internet connection:
import os
import logging
from bugzilla import Bugzilla
from bugzilla.exceptions import BugzillaError
from requests.exceptions import RequestException
URL = os.getenv("URL", "https://bugzilla.suse.com")
USER = os.getenv("USER", "test")
API_KEY = "MYAPIKEY"
try:
client = Bugzilla(URL, force_rest=True, user=USER, api_key=API_KEY)
except (BugzillaError, RequestException) as exc:
error = exc
logging.error("%s", exc)
ERROR:root:HTTPSConnectionPool(host='bugzilla.suse.com', port=443): Max retries exceeded with url: /rest/version?Bugzilla_api_key=MYAPIKEY (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f48458cbf90>: Failed to resolve 'bugzilla.suse.com' ([Errno -3] Temporary failure in name resolution)"))
The only workaround is to catch requests.exceptions.ConnectionError.
Metadata
Metadata
Assignees
Labels
No labels