Skip to content

Commit

Permalink
Merge branch 'dev' into dependabot/pip/yarl-1.18.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bachya authored Dec 27, 2024
2 parents 4f919ab + f1084e9 commit 6f6de84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions pytile/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,16 @@ async def _async_request(
kwargs["headers"]["tile_app_version"] = DEFAULT_APP_VERSION
kwargs["headers"]["tile_client_uuid"] = self.client_uuid

async with self._session.request(
method, f"{API_URL_SCAFFOLD}/{endpoint}", **kwargs
) as resp:
try:
try:
async with self._session.request(
method, f"{API_URL_SCAFFOLD}/{endpoint}", **kwargs
) as resp:
resp.raise_for_status()
data = await resp.json()
except ClientError as err:
if "401" in str(err):
raise InvalidAuthError("Invalid credentials") from err
raise RequestError(
f"Error requesting data from {endpoint}: {err}"
) from err
except ClientError as err:
if "401" in str(err):
raise InvalidAuthError("Invalid credentials") from err
raise RequestError(f"Error requesting data from {endpoint}: {err}") from err

LOGGER.debug("Data received from /%s: %s", endpoint, data)

Expand Down

0 comments on commit 6f6de84

Please sign in to comment.