mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-13 18:18:08 +00:00
core: nicer output for cancellations
This commit is contained in:
parent
0811733185
commit
b25537f6b0
@ -40,7 +40,7 @@ from trezor import log, loop, messages, ui, utils, workflow
|
|||||||
from trezor.messages import FailureType
|
from trezor.messages import FailureType
|
||||||
from trezor.messages.Failure import Failure
|
from trezor.messages.Failure import Failure
|
||||||
from trezor.wire import codec_v1
|
from trezor.wire import codec_v1
|
||||||
from trezor.wire.errors import Error
|
from trezor.wire.errors import ActionCancelled, Error
|
||||||
|
|
||||||
# Import all errors into namespace, so that `wire.Error` is available from
|
# Import all errors into namespace, so that `wire.Error` is available from
|
||||||
# other packages.
|
# other packages.
|
||||||
@ -364,6 +364,9 @@ async def handle_session(iface: WireInterface, session_id: int) -> None:
|
|||||||
# - the first workflow message was not a valid protobuf
|
# - the first workflow message was not a valid protobuf
|
||||||
# - workflow raised some kind of an exception while running
|
# - workflow raised some kind of an exception while running
|
||||||
if __debug__:
|
if __debug__:
|
||||||
|
if isinstance(exc, ActionCancelled):
|
||||||
|
log.debug(__name__, "cancelled: {}".format(exc.message))
|
||||||
|
else:
|
||||||
log.exception(__name__, exc)
|
log.exception(__name__, exc)
|
||||||
res_msg = failure(exc)
|
res_msg = failure(exc)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user