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 <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <[email protected]>
Gerrit-CC: osmith <[email protected]>
Gerrit-Attention: osmith <[email protected]>
Gerrit-Attention: laforge <[email protected]>
Gerrit-Comment-Date: Wed, 30 Aug 2023 15:09:20 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <[email protected]>
Comment-In-Reply-To: laforge <[email protected]>
Comment-In-Reply-To: dexter <[email protected]>
Gerrit-MessageType: comment

Reply via email to