Skip to content

Commit

Permalink
raise CommException with response data
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Ruiz de Sotto <miguel.ruiz-de-sotto@ledger.fr>
  • Loading branch information
mruiz-ledger committed Apr 30, 2024
1 parent 9e7a94a commit f958b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ledgerblue/commTCP.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_data():
# When more data is available, the chip sends 0x61XX
# So 0x61xx as a SW must not be interpreted as an error
if (sw & 0xFF00) != 0x6100:
raise CommException("Invalid status %04x" % sw, sw)
raise CommException("Invalid status %04x" % sw, sw, data=response)
else:
while (sw & 0xFF00) == 0x6100:
send_apdu(bytes.fromhex("00c0000000")) # GET RESPONSE
Expand All @@ -72,7 +72,7 @@ def get_data():
return bytearray(response)

# In any other case return an exception
raise CommException("Invalid status %04x" % sw, sw)
raise CommException("Invalid status %04x" % sw, sw, data=response)

def apduMaxDataSize(self):
return 240
Expand Down

0 comments on commit f958b35

Please sign in to comment.