gattlib-py/gattlib/exception: Print 'le-connection-abort-by-local' on related exception

pull/267/head
Olivier Martin 2024-02-19 12:11:05 +01:00 committed by Olivier Martin
parent 7922810016
commit 7a8d53d817
1 changed files with 4 additions and 2 deletions

View File

@ -59,8 +59,10 @@ class DBusError(GattlibException):
self.code = code
def __str__(self) -> str:
return f"DBus Error domain={self.domain},code={self.code}"
if self.domain == 238 and self.code == 60964:
return f"DBus Error: le-connection-abort-by-local"
else:
return f"DBus Error domain={self.domain},code={self.code}"
def handle_return(ret):
if ret == GATTLIB_INVALID_PARAMETER: