From 7644cb4c79feaf02198ccbfcbacbf659d9633ae4 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Thu, 17 Oct 2019 15:56:09 +0000 Subject: [PATCH] core: rework exception handling in boot.py --- core/src/boot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/src/boot.py b/core/src/boot.py index 4c3214e3d2..191791dc57 100644 --- a/core/src/boot.py +++ b/core/src/boot.py @@ -2,8 +2,8 @@ from trezor import config, io, log, loop, res, ui, utils from trezor.pin import pin_to_int, show_pin_timeout from apps.common import storage -from apps.common.request_pin import request_pin -from apps.common.sd_salt import request_sd_salt +from apps.common.request_pin import PinCancelled, request_pin +from apps.common.sd_salt import SdProtectCancelled, request_sd_salt from apps.common.storage import device if False: @@ -39,9 +39,11 @@ async def bootscreen() -> None: return else: label = "Wrong PIN, enter again" - except Exception as e: + except (OSError, PinCancelled, SdProtectCancelled) as e: if __debug__: log.exception(__name__, e) + except Exception as e: + utils.halt(e.__class__.__name__) async def lockscreen() -> None: