1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-13 19:18:56 +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
await ctx.write(Failure(code=exc.code, message=exc.message))
raise
except Exception:
except Exception as e:
# respond with a generic code and message
await ctx.write(
Failure(code=FailureType.FirmwareError, message="Firmware error")
)
message = "Firmware error"
if __debug__:
message = "{}: {}".format(type(e), e)
await ctx.write(Failure(code=FailureType.FirmwareError, message=message))
raise
if res:
# respond with a specific response