mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-08-05 18:11:41 +00:00
Logging improvements
This commit is contained in:
@@ -4,7 +4,7 @@ from threading import Thread, Event
|
||||
|
||||
import pytz
|
||||
import requests
|
||||
from requests.exceptions import ConnectionError, ReadTimeout
|
||||
from requests.exceptions import ConnectionError, ReadTimeout, ConnectTimeout
|
||||
|
||||
from alertproviders.alert_provider import AlertProvider
|
||||
from core.constants import HTTP_HEADERS
|
||||
@@ -59,8 +59,8 @@ class HTTPAlertProvider(AlertProvider):
|
||||
|
||||
except ConnectionError:
|
||||
logging.warning(f"Connection error when accessing {self.name} alerts API.")
|
||||
except ReadTimeout:
|
||||
logging.warning(f"Read timeout when accessing {self.name} alerts API.")
|
||||
except (ConnectTimeout, ReadTimeout):
|
||||
logging.warning(f"Timeout when accessing {self.name} alerts API.")
|
||||
except Exception:
|
||||
self.status = "Error"
|
||||
logging.exception("Exception in HTTP JSON Alert Provider (" + self.name + ")")
|
||||
|
||||
Reference in New Issue
Block a user