mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-13 18:18:08 +00:00
firmware: log exceptions in debug mode (no silent unhandled exceptions)
This commit is contained in:
parent
f07dfe9344
commit
b2327c37b7
@ -416,8 +416,10 @@ class ConfirmContent(ui.Widget):
|
|||||||
try:
|
try:
|
||||||
namepart = name.lower().replace(" ", "_")
|
namepart = name.lower().replace(" ", "_")
|
||||||
icon = res.load("apps/fido_u2f/res/u2f_%s.toif" % namepart)
|
icon = res.load("apps/fido_u2f/res/u2f_%s.toif" % namepart)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
icon = res.load("apps/fido_u2f/res/u2f_generic.toif")
|
icon = res.load("apps/fido_u2f/res/u2f_generic.toif")
|
||||||
|
if __debug__:
|
||||||
|
log.exception(__name__, e)
|
||||||
else:
|
else:
|
||||||
name = "%s...%s" % (
|
name = "%s...%s" % (
|
||||||
hexlify(self.app_id[:4]).decode(),
|
hexlify(self.app_id[:4]).decode(),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from trezor import config, loop, res, ui
|
from trezor import config, log, loop, res, ui
|
||||||
from trezor.pin import pin_to_int, show_pin_timeout
|
from trezor.pin import pin_to_int, show_pin_timeout
|
||||||
|
|
||||||
from apps.common.request_pin import request_pin
|
from apps.common.request_pin import request_pin
|
||||||
@ -18,8 +18,9 @@ async def bootscreen():
|
|||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
label = "Wrong PIN, enter again"
|
label = "Wrong PIN, enter again"
|
||||||
except: # noqa: E722
|
except Exception as e:
|
||||||
pass
|
if __debug__:
|
||||||
|
log.exception(__name__, e)
|
||||||
|
|
||||||
|
|
||||||
async def lockscreen():
|
async def lockscreen():
|
||||||
|
@ -261,6 +261,8 @@ class spawn(Syscall):
|
|||||||
result = await child
|
result = await child
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._finish(child, index, e)
|
self._finish(child, index, e)
|
||||||
|
if __debug__:
|
||||||
|
log.exception(__name__, e)
|
||||||
else:
|
else:
|
||||||
self._finish(child, index, result)
|
self._finish(child, index, result)
|
||||||
|
|
||||||
|
@ -29,4 +29,8 @@ def get_type(wire_type):
|
|||||||
|
|
||||||
# build reverse table of wire types
|
# build reverse table of wire types
|
||||||
for msg_name in dir(MessageType):
|
for msg_name in dir(MessageType):
|
||||||
|
# Modules contain internal variables that may cause exception here.
|
||||||
|
# No Message begins with underscore so it's safe to skip those.
|
||||||
|
if (msg_name[0] == '_'):
|
||||||
|
continue
|
||||||
type_to_name[getattr(MessageType, msg_name)] = msg_name
|
type_to_name[getattr(MessageType, msg_name)] = msg_name
|
||||||
|
Loading…
Reference in New Issue
Block a user