mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-17 13:12:05 +00:00
core: return exception details in debug mode (#238)
This commit is contained in:
parent
ebc22e5ccb
commit
a4c0645622
@ -173,11 +173,12 @@ async def protobuf_workflow(ctx, reader, handler, *args):
|
|||||||
# respond with specific code and message
|
# respond with specific code and message
|
||||||
await ctx.write(Failure(code=exc.code, message=exc.message))
|
await ctx.write(Failure(code=exc.code, message=exc.message))
|
||||||
raise
|
raise
|
||||||
except Exception:
|
except Exception as e:
|
||||||
# respond with a generic code and message
|
# respond with a generic code and message
|
||||||
await ctx.write(
|
message = "Firmware error"
|
||||||
Failure(code=FailureType.FirmwareError, message="Firmware error")
|
if __debug__:
|
||||||
)
|
message = "{}: {}".format(type(e), e)
|
||||||
|
await ctx.write(Failure(code=FailureType.FirmwareError, message=message))
|
||||||
raise
|
raise
|
||||||
if res:
|
if res:
|
||||||
# respond with a specific response
|
# respond with a specific response
|
||||||
|
Loading…
Reference in New Issue
Block a user