From 4d3c59f2b5bf1e3afc620b12370be16db36a3688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 3 Aug 2023 00:38:53 +0100 Subject: Be more verbose on error messages and parsing with construct. Instead of manually combining and parsing integers (particularly IV that is a 56-bit integer), use construct formats to handle the parsing. --- freestyle_hid/_exceptions.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'freestyle_hid/_exceptions.py') diff --git a/freestyle_hid/_exceptions.py b/freestyle_hid/_exceptions.py index 2b803f8..aa71e7c 100644 --- a/freestyle_hid/_exceptions.py +++ b/freestyle_hid/_exceptions.py @@ -10,6 +10,10 @@ class ConnectionError(Exception): """Errors related to Session establishment.""" +class EncryptionHandshakeError(ConnectionError): + """Errors related to encryption handshake.""" + + class ChecksumError(Exception): """Errors related to the transmission checksums.""" @@ -18,6 +22,10 @@ class CommandError(Exception): """Errors related to the command stream.""" +class EncryptionNotInitialized(CommandError): + """Device needs encryption handshake.""" + + class MissingFreeStyleKeys(Exception): """The freestyle-hid-keys package is missing.""" -- cgit v1.2.3