From 86ad10e8bddc63100435daf7b299680b78083328 Mon Sep 17 00:00:00 2001 From: M1nd3r Date: Sun, 31 Mar 2024 18:33:33 +0200 Subject: [PATCH] Add description to UnexpectedMessageWithType --- core/src/trezor/wire/thp/session_context.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/trezor/wire/thp/session_context.py b/core/src/trezor/wire/thp/session_context.py index c9a04cb8d..2054ae59e 100644 --- a/core/src/trezor/wire/thp/session_context.py +++ b/core/src/trezor/wire/thp/session_context.py @@ -16,6 +16,12 @@ if TYPE_CHECKING: class UnexpectedMessageWithType(Exception): + """A message was received that is not part of the current workflow. + + Utility exception to inform the session handler that the current workflow + should be aborted and a new one started as if `msg` was the first message. + """ + def __init__(self, msg: MessageWithType) -> None: super().__init__() self.msg = msg