1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-11 16:00:57 +00:00

core: improve log output for ui.Result exception (#429)

* core: improve log output for ui.Result exception

updates #373

* core: avoid importing ui module
This commit is contained in:
Tomas Susanka 2019-08-22 15:31:20 +02:00 committed by Jan Pochyla
parent 132c841752
commit 16b44b6f7b

View File

@ -59,5 +59,9 @@ def critical(name: str, msg: str, *args: Any) -> None:
def exception(name: str, exc: BaseException) -> None: def exception(name: str, exc: BaseException) -> None:
# we are using `__class__.__name__` to avoid importing ui module
if exc.__class__.__name__ == "Result":
_log(name, DEBUG, "ui.Result: %s", exc.value)
else:
_log(name, ERROR, "exception:") _log(name, ERROR, "exception:")
sys.print_exception(exc) sys.print_exception(exc)