dexter has uploaded this change for review. (
https://gerrit.osmocom.org/c/pysim/+/34155
)
Change subject: sim-reset-server: fix error printing sw_match_error
......................................................................
sim-reset-server: fix error printing sw_match_error
When a status word other than 9862 or 6982 is received, then
failure.value is included in the error message string. Unfortunately the
value object cannot be converted to string. An exception is raised:
builtins.TypeError: decoding to str: need a bytes-like object, ApiError found
To fix this, let's exclude failure.value from the string.
Related: OS#67094
Change-Id: I5a1d19abeb00c2c9dc26517abc44a5c916f2d658
---
M contrib/sim-rest-server.py
1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/55/34155/1
diff --git a/contrib/sim-rest-server.py b/contrib/sim-rest-server.py
index 83fb377..ed5176b 100755
--- a/contrib/sim-rest-server.py
+++ b/contrib/sim-rest-server.py
@@ -101,7 +101,7 @@
elif sw == '6982':
return str(ApiError("Security Status not satisfied - Card PIN
enabled?", sw))
else:
- return str(ApiError("Card Communication Error %s" % failure.value),
sw)
+ return str(ApiError("Card Communication Error", sw))
@app.route('/sim-auth-api/v1/slot/<int:slot>')
--
To view, visit
https://gerrit.osmocom.org/c/pysim/+/34155
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5a1d19abeb00c2c9dc26517abc44a5c916f2d658
Gerrit-Change-Number: 34155
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange