Skip to content

Commit

Permalink
Fix handling unauthorized
Browse files Browse the repository at this point in the history
  • Loading branch information
zhulik committed Jul 28, 2020
1 parent cce90d6 commit a35a4ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion aiosyncthing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ async def request(self, *args, **kwargs):
try:
return await self.raw_request(*args, **kwargs)
except aiohttp.client_exceptions.ClientResponseError as error:
if error.status == 401:
if error.status in [401, 403]:
raise UnauthorizedError from error
raise error
except Exception as error:
raise SyncthingError from error

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="aiosyncthing",
version="0.2.3",
version="0.2.4",
author="Gleb Sinyavskiy",
author_email="zhulik.gleb@gmail.com",
description="Asynchronous Python client for the Syncthing REST API",
Expand Down

0 comments on commit a35a4ee

Please sign in to comment.