This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Pau Espin Pedrol gerrit-no-reply at lists.osmocom.orgPau Espin Pedrol has submitted this change and it was merged.
Change subject: modem: Improve handling of errors in dbus_call_dismiss_error
......................................................................
modem: Improve handling of errors in dbus_call_dismiss_error
Change-Id: I25d08c74608c3ec5c6e46c36c161e777b2ed337a
---
M src/osmo_gsm_tester/modem.py
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified
diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index e8f57cc..bff62bb 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -145,11 +145,11 @@
 def dbus_call_dismiss_error(log_obj, err_str, method):
     try:
         method()
-    except Exception as e:
-        if isinstance(e, GLib.Error) and err_str in e.domain:
+    except GLib.Error as e:
+        if Gio.DBusError.is_remote_error(e) and Gio.DBusError.get_remote_error(e) == err_str:
             log_obj.log('Dismissed Dbus method error: %r' % e)
             return
-        raise log.Error('dbus_call_dismiss_error raised error %r' % e)
+        raise e
 
 class ModemDbusInteraction(log.Origin):
     '''Work around inconveniences specific to pydbus and ofono.
-- 
To view, visit https://gerrit.osmocom.org/4719
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I25d08c74608c3ec5c6e46c36c161e777b2ed337a
Gerrit-PatchSet: 2
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>