This commit is contained in:
Dain Nilsson 2022-05-13 09:39:16 +02:00
commit e86c50fb64
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
3 changed files with 14 additions and 13 deletions

View File

@ -195,8 +195,8 @@ class RpcNode:
logger.debug("close existing child: %s", self._child_name)
try:
self._child.close()
except Exception as e:
logger.error("Error closing child", exc_info=e)
except Exception:
logger.exception("Error closing child")
self._child = None
self._child_name = None

View File

@ -225,8 +225,8 @@ class AbstractDeviceNode(RpcNode):
def __call__(self, *args, **kwargs):
try:
return super().__call__(*args, **kwargs)
except (SmartcardException, OSError) as e:
logger.error("Device error", exc_info=e)
except (SmartcardException, OSError):
logger.exception("Device error")
self._child = None
name = self._child_name
self._child_name = None
@ -236,7 +236,7 @@ class AbstractDeviceNode(RpcNode):
try:
return super().create_child(name)
except (SmartcardException, OSError):
logger.error(f"Unable to create child {name}", exc_info=True)
logger.exception(f"Unable to create child {name}")
raise NoSuchNodeException(name)
def get_data(self):
@ -285,8 +285,9 @@ class UsbDeviceNode(AbstractDeviceNode):
class ReaderDeviceNode(AbstractDeviceNode):
def get_data(self):
try:
return super().get_data() | dict(present=True)
return {**super().get_data(), "present": True}
except Exception:
logger.debug("Couldn't get NFC device info, present=False", exc_info=True)
return dict(present=False)
@child
@ -315,7 +316,7 @@ class ConnectionNode(RpcNode):
try:
return super().__call__(*args, **kwargs)
except (SmartcardException, OSError) as e:
logger.error("Connection error", exc_info=e)
logger.exception("Connection error")
raise ChildResetException(f"{e}")
except ApduError as e:
if e.sw == SW.INVALID_INSTRUCTION:
@ -330,8 +331,8 @@ class ConnectionNode(RpcNode):
super().close()
try:
self._connection.close()
except Exception as e:
logger.warning("Error closing connection", exc_info=e)
except Exception:
logger.warning("Error closing connection", exc_info=True)
def get_data(self):
if (

8
helper/poetry.lock generated
View File

@ -271,7 +271,7 @@ python-versions = ">=3.7"
[[package]]
name = "pyparsing"
version = "3.0.8"
version = "3.0.9"
description = "pyparsing module - Classes and methods to define and execute parsing grammars"
category = "dev"
optional = false
@ -370,7 +370,7 @@ pywin32 = {version = ">=223", markers = "sys_platform == \"win32\""}
type = "git"
url = "https://github.com/Yubico/yubikey-manager.git"
reference = "next"
resolved_reference = "61b902b5f61024b27f32ef88b2f95bb7630afdfb"
resolved_reference = "b1d05ea89f8988bf717e5e9073a4c3a3e7ec1bc2"
[[package]]
name = "zipp"
@ -626,8 +626,8 @@ pyinstaller-hooks-contrib = [
{file = "pyinstaller_hooks_contrib-2022.4-py2.py3-none-any.whl", hash = "sha256:b57a90bb8520d6e1dbbaaae416875e28fa5a3b74d2e40e330d02d1ccadacc38c"},
]
pyparsing = [
{file = "pyparsing-3.0.8-py3-none-any.whl", hash = "sha256:ef7b523f6356f763771559412c0d7134753f037822dad1b16945b7b846f7ad06"},
{file = "pyparsing-3.0.8.tar.gz", hash = "sha256:7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954"},
{file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"},
{file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"},
]
pyscard = [
{file = "pyscard-2.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:f7748157d293f57688307f94d780c93bd3ceaf309b39b92a0af792bf1ddb82e7"},