We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c1092c4 + 5eba889 commit 96875a8Copy full SHA for 96875a8
speculos/client.py
@@ -14,9 +14,10 @@
14
15
16
class ApduException(Exception):
17
- def __init__(self, sw: int = 0x6F00) -> None:
+ def __init__(self, sw: int, data: bytes) -> None:
18
super().__init__(f"Exception: invalid status 0x{sw:x}")
19
self.sw = sw
20
+ self.data = data
21
22
23
class ClientException(Exception):
@@ -38,7 +39,7 @@ def receive(self) -> bytes:
38
39
check_status_code(self.response, "/apdu")
40
data, status = split_apdu(bytes.fromhex(self.response.json()["data"]))
41
if status != 0x9000:
- raise ApduException(status)
42
+ raise ApduException(status, data)
43
return data
44
45
0 commit comments