diff --git a/website/contrib/code_block/healthchecks.py b/website/contrib/code_block/healthchecks.py index 55608f3..d690e2a 100644 --- a/website/contrib/code_block/healthchecks.py +++ b/website/contrib/code_block/healthchecks.py @@ -5,7 +5,10 @@ from .utils import _get_linguist_colours class GitHubLinguistHealthCheckBackend(BaseHealthCheckBackend): def check_status(self) -> None: - colours = _get_linguist_colours() + try: + colours = _get_linguist_colours() + except Exception as e: + self.add_error(str(e)) if colours is None: self.add_error("No colours provided") diff --git a/website/spotify/healthchecks.py b/website/spotify/healthchecks.py index 937c928..0f72319 100644 --- a/website/spotify/healthchecks.py +++ b/website/spotify/healthchecks.py @@ -5,9 +5,12 @@ from health_check.backends import BaseHealthCheckBackend class SpotifyHealthCheckBackend(BaseHealthCheckBackend): def check_status(self) -> None: - requests.get( - f"https://{settings.SPOTIFY_PROXY_HOST}/.health/" - ).raise_for_status() + try: + requests.get( + f"https://{settings.SPOTIFY_PROXY_HOST}/.health/" + ).raise_for_status() + except Exception as e: + self.add_error(str(e)) def identifier(self) -> str: return "Spotify Proxy"