fix plus active check and add logging

This commit is contained in:
Blake Blackshear
2022-05-11 06:54:46 -05:00
parent 691ed6a4c7
commit 358d0521a1
2 changed files with 13 additions and 8 deletions

View File

@@ -44,6 +44,8 @@ class PlusApi:
raise Exception("Plus API not activated")
parts = self.key.split(":")
r = requests.get(f"{self.host}/v1/auth/token", auth=(parts[0], parts[1]))
if not r.ok:
raise Exception("Unable to refresh API token")
self._token_data = r.json()
def _get_authorization_header(self) -> dict: