From f23277a1877af7d3cd27213a163455cdee027060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 26 Jan 2022 18:11:40 +0100 Subject: [PATCH] Only log exception in GitHub when something unexpected raised (#64974) --- homeassistant/components/github/coordinator.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/github/coordinator.py b/homeassistant/components/github/coordinator.py index faa48e44d0b..32f0df98e1f 100644 --- a/homeassistant/components/github/coordinator.py +++ b/homeassistant/components/github/coordinator.py @@ -6,8 +6,10 @@ from typing import Literal, TypedDict from aiogithubapi import ( GitHubAPI, GitHubCommitModel, + GitHubConnectionException, GitHubException, GitHubNotModifiedException, + GitHubRatelimitException, GitHubReleaseModel, GitHubRepositoryModel, GitHubResponseModel, @@ -69,7 +71,11 @@ class GitHubBaseDataUpdateCoordinator(DataUpdateCoordinator[T]): ) # Return the last known data if the request result was not modified return self.data + except (GitHubConnectionException, GitHubRatelimitException) as exception: + # These are expected and we dont log anything extra + raise UpdateFailed(exception) from exception except GitHubException as exception: + # These are unexpected and we log the trace to help with troubleshooting LOGGER.exception(exception) raise UpdateFailed(exception) from exception else: