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
--
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: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 30 Aug 2023 15:09:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment