Only log exception in GitHub when something unexpected raised (#64974)
parent
d14fbf40c8
commit
f23277a187
|
@ -6,8 +6,10 @@ from typing import Literal, TypedDict
|
||||||
from aiogithubapi import (
|
from aiogithubapi import (
|
||||||
GitHubAPI,
|
GitHubAPI,
|
||||||
GitHubCommitModel,
|
GitHubCommitModel,
|
||||||
|
GitHubConnectionException,
|
||||||
GitHubException,
|
GitHubException,
|
||||||
GitHubNotModifiedException,
|
GitHubNotModifiedException,
|
||||||
|
GitHubRatelimitException,
|
||||||
GitHubReleaseModel,
|
GitHubReleaseModel,
|
||||||
GitHubRepositoryModel,
|
GitHubRepositoryModel,
|
||||||
GitHubResponseModel,
|
GitHubResponseModel,
|
||||||
|
@ -69,7 +71,11 @@ class GitHubBaseDataUpdateCoordinator(DataUpdateCoordinator[T]):
|
||||||
)
|
)
|
||||||
# Return the last known data if the request result was not modified
|
# Return the last known data if the request result was not modified
|
||||||
return self.data
|
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:
|
except GitHubException as exception:
|
||||||
|
# These are unexpected and we log the trace to help with troubleshooting
|
||||||
LOGGER.exception(exception)
|
LOGGER.exception(exception)
|
||||||
raise UpdateFailed(exception) from exception
|
raise UpdateFailed(exception) from exception
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue