diff options
author | Devaev Maxim <[email protected]> | 2020-05-17 14:46:10 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-05-17 14:46:10 +0300 |
commit | 1251b8d705c5a48a78290b2d25cd4de048245035 (patch) | |
tree | ef85f4a61d42d03aab9e187f3c25a0f40b551d9e /kvmd/apps/vnc/streamer.py | |
parent | 2eef3061ce8e3222da7864bfe4fd2bf767b5e5f1 (diff) |
better error handling
Diffstat (limited to 'kvmd/apps/vnc/streamer.py')
-rw-r--r-- | kvmd/apps/vnc/streamer.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kvmd/apps/vnc/streamer.py b/kvmd/apps/vnc/streamer.py index fd2232ee..094f5081 100644 --- a/kvmd/apps/vnc/streamer.py +++ b/kvmd/apps/vnc/streamer.py @@ -31,7 +31,8 @@ from ... import __version__ # ===== class StreamerError(Exception): - pass + def __init__(self, err: Exception): + super().__init__(f"{type(err).__name__} {err}") # ===== @@ -71,7 +72,7 @@ class StreamerClient: bytes(await frame.read()), ) except Exception as err: # Тут бывают и ассерты, и KeyError, и прочая херня из-за корявых исключений в MultipartReader - raise StreamerError(f"{type(err).__name__}: {str(err)}") + raise StreamerError(err) def __make_session(self) -> aiohttp.ClientSession: kwargs: Dict = { |