mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-23 00:57:26 +03:00
Clean up logging of exceptions.
This commit is contained in:
parent
50355d241e
commit
661a8012cd
@ -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
|
||||
|
||||
|
@ -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):
|
||||
@ -316,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:
|
||||
@ -331,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 (
|
||||
|
Loading…
Reference in New Issue
Block a user