Fix httpclient exceptions on read and improve error info (#655)

This commit is contained in:
Steven B
2024-01-19 20:06:50 +00:00
committed by GitHub
parent 0647adaba0
commit 38159140fb
3 changed files with 121 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
"""python-kasa exceptions."""
from asyncio import TimeoutError
from enum import IntEnum
from typing import Optional
@@ -27,9 +28,15 @@ class RetryableException(SmartDeviceException):
"""Retryable exception for device errors."""
class TimeoutException(SmartDeviceException):
class TimeoutException(SmartDeviceException, TimeoutError):
"""Timeout exception for device errors."""
def __repr__(self):
return SmartDeviceException.__repr__(self)
def __str__(self):
return SmartDeviceException.__str__(self)
class ConnectionException(SmartDeviceException):
"""Connection exception for device errors."""