From 3a37ad015c3fab6d2e34a08e16a1d6197f8bdfba Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 16 Aug 2023 12:08:56 +0200 Subject: [PATCH] sim-reset-server: fix error printing sw_match_error In the last line of the if,elif,else branch, when we print the ApiError object, we pass the variable sw to str() instead passing it to ApiError() like we do it in the lines above. This is not correct and causes strange exceptions. Related: OS#67094 Change-Id: I5a1d19abeb00c2c9dc26517abc44a5c916f2d658 --- contrib/sim-rest-server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/sim-rest-server.py b/contrib/sim-rest-server.py index 83fb377d..fc8afd94 100755 --- a/contrib/sim-rest-server.py +++ b/contrib/sim-rest-server.py @@ -101,7 +101,7 @@ class SimRestServer: 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 %s" % failure.value, sw)) @app.route('/sim-auth-api/v1/slot/')