[gnome-keysign: 10/65] bluetoothoffer: better error handling when BT	is not available
- From: Gitlab System User <gitlab src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-keysign: 10/65] bluetoothoffer: better error handling when BT	is not available
 
- Date: Tue,  3 Oct 2017 11:37:44 +0000 (UTC)
 
commit a7a9b37d64a389b175cdbb2efe534ad9b7e81764
Author: RyuzakiKK <aasonykk gmail com>
Date:   Tue Aug 8 22:55:22 2017 +0200
    bluetoothoffer: better error handling when BT is not available
 keysign/bluetoothoffer.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/keysign/bluetoothoffer.py b/keysign/bluetoothoffer.py
index 55c767a..59978e9 100644
--- a/keysign/bluetoothoffer.py
+++ b/keysign/bluetoothoffer.py
@@ -67,8 +67,6 @@ class BluetoothOffer:
             success = False
             message = e
 
-        #if not self.stopped:
-        #    returnValue((success, message))
         returnValue((success, message))
 
     def generate_code(self):
@@ -76,7 +74,9 @@ class BluetoothOffer:
             code = get_local_bt_address().upper()
         except dbus.exceptions.DBusException as e:
             if e.get_dbus_name() == "org.freedesktop.systemd1.NoSuchUnit":
-                log.info("No Bluetooth devices found")
+                log.info("No Bluetooth devices found, probably the bluetooth service is not running")
+            elif e.get_dbus_name() == "org.freedesktop.DBus.Error.UnknownObject":
+                log.info("No Bluetooth devices available")
             else:
                 log.error("An unexpected error occurred %s", e.get_dbus_name())
             self.code = None
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]