Skip to content

Commit 7f827fd

Browse files
committed
Handle both Unauth and Forbidden
1 parent 128b113 commit 7f827fd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

airos/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ async def _request_json(
241241
_LOGGER.error(
242242
"Request to %s failed with status %s: %s", url, err.status, err.message
243243
)
244-
if err.status == 401:
244+
if err.status in [401, 403]:
245245
raise AirOSConnectionAuthenticationError from err
246246
raise AirOSConnectionSetupError from err
247247
except (TimeoutError, aiohttp.ClientError) as err:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "airos"
7-
version = "0.5.1"
7+
version = "0.5.2"
88
license = "MIT"
99
description = "Ubiquiti airOS module(s) for Python 3."
1010
readme = "README.md"

0 commit comments

Comments
 (0)