diff --git a/lib/charms/loki_k8s/v1/loki_push_api.py b/lib/charms/loki_k8s/v1/loki_push_api.py index 4bc4e22a..e2a61959 100644 --- a/lib/charms/loki_k8s/v1/loki_push_api.py +++ b/lib/charms/loki_k8s/v1/loki_push_api.py @@ -490,7 +490,7 @@ def _alert_rules_error(self, event): from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union from urllib import request -from urllib.error import HTTPError +from urllib.error import URLError import yaml from cosl import JujuTopology @@ -519,7 +519,7 @@ def _alert_rules_error(self, event): # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 6 +LIBPATCH = 7 logger = logging.getLogger(__name__) @@ -2326,7 +2326,7 @@ def _ensure_promtail_binary(self, promtail_binaries: dict, container: Container) try: self._obtain_promtail(promtail_binaries[self._arch], container) - except HTTPError as e: + except URLError as e: msg = f"Promtail binary couldn't be downloaded - {str(e)}" logger.warning(msg) self.on.promtail_digest_error.emit(msg)