1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

core: return exception details in debug mode (#238)

This commit is contained in:
Roman Zeyde 2019-06-11 18:07:18 +03:00 committed by Pavol Rusnak
parent ebc22e5ccb
commit a4c0645622

View File

@ -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