Skip to content

Commit

Permalink
Fix aiohttp deprecation message
Browse files Browse the repository at this point in the history
ClientResponseError's code property has been deprecated since version
3.1 and is replaced by the equivalent status property.
  • Loading branch information
tjni committed Aug 6, 2023
1 parent 7b27323 commit c672178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion moonraker_api/websockets/websocketclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ async def set_exception(exception: BaseException) -> None:

except ClientResponseError as error:
_LOGGER.warning("Websocket request error: %s", error)
if error.code == 401:
if error.status == 401:
_LOGGER.error("API access is unauthorized")
self.state = WEBSOCKET_STATE_STOPPING
await set_exception(ClientNotAuthenticatedError)
Expand Down

0 comments on commit c672178

Please sign in to comment.