Attention is currently required from: osmith, laforge.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34155 )
Change subject: sim-reset-server: fix error printing sw_match_error ......................................................................
Patch Set 2:
(1 comment)
File contrib/sim-rest-server.py:
https://gerrit.osmocom.org/c/pysim/+/34155/comment/5e568e7f_80c4daf4 PS1, Line 104: failure.value
I think you need a __str__ method on the object in order for str() to work. […]
I think there is presumably a problem in the stuff that gets called by the __str__ method in the ApiError object.
The failure happens when there is a status word returned that is not 9862 or 6982. In practice this rarely happens. I have to cement out the if,elif,else branches before "return str(ApiError("Card Communication Error %s" % failure.value), sw)" in order to be able to trigger the problem.
The backtrace looks like this: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/klein/_resource.py", line 291, in processing_failed return processing_failed(failure, error_handlers[1:]) File "/usr/local/lib/python3.9/dist-packages/klein/_resource.py", line 291, in processing_failed return processing_failed(failure, error_handlers[1:]) File "/usr/local/lib/python3.9/dist-packages/klein/_resource.py", line 291, in processing_failed return processing_failed(failure, error_handlers[1:]) File "/usr/local/lib/python3.9/dist-packages/klein/_resource.py", line 280, in processing_failed d = maybeDeferred( --- <exception caught here> --- File "/usr/local/lib/python3.9/dist-packages/twisted/internet/defer.py", line 206, in maybeDeferred result = f(*args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/klein/_app.py", line 241, in execute_error_handler return handler(self._instance, request, failure) File "/usr/local/lib/python3.9/dist-packages/klein/_app.py", line 512, in _f return _call(instance, f, request, failure) File "/usr/local/lib/python3.9/dist-packages/klein/_app.py", line 124, in _call result = __klein_f__(*args, **kwargs) File "/home/owner/git_master/pysim/./sim-rest-server.py", line 104, in sw_match_error return str(ApiError("Card Communication Error %s" % failure.value), sw) builtins.TypeError: decoding to str: need a bytes-like object, ApiError found