test-session: Handle all net.connman.Error.Failed exceptions
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Mon, 18 Apr 2011 09:27:02 +0000 (11:27 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Tue, 19 Apr 2011 09:30:52 +0000 (11:30 +0200)
test/test-session

index 2ded3d9..9784122 100755 (executable)
@@ -147,7 +147,7 @@ class SessionApplication(dbus.service.Object):
                                                      "net.connman.Session")
 
                except dbus.DBusException, e:
-                       if e.get_dbus_name() in ['net.connman.Error.InvalidArguments']:
+                       if e.get_dbus_name() in ['net.connman.Error.Failed']:
                                print e.get_dbus_message()
                                return
                        traceback.print_exc()
@@ -175,8 +175,7 @@ class SessionApplication(dbus.service.Object):
                try:
                        self.session.Connect()
                except dbus.DBusException, e:
-                       if e.get_dbus_name() in ['net.connman.Error.InProgress',
-                                                'net.connman.Error.AlreadyConnected']:
+                       if e.get_dbus_name() in ['net.connman.Error.Failed']:
                                print e.get_dbus_message()
                                return
                        traceback.print_exc()
@@ -189,8 +188,7 @@ class SessionApplication(dbus.service.Object):
                try:
                        self.session.Disconnect()
                except dbus.DBusException, e:
-                       if e.get_dbus_name() in ['net.connman.Error.AlreadyDisabled',
-                                                'net.connman.Error.NotConnected']:
+                       if e.get_dbus_name() in ['net.connman.Error.Failed']:
                                print e.get_dbus_message()
                                return
                        traceback.print_exc()
@@ -204,7 +202,7 @@ class SessionApplication(dbus.service.Object):
                        val = self.type_convert(key, value)
                        self.session.Change(key, val)
                except dbus.DBusException, e:
-                       if e.get_dbus_name() in ['net.connman.Error.InvalidArguments']:
+                       if e.get_dbus_name() in ['net.connman.Error.Failed']:
                                print e.get_dbus_message()
                                return
                        traceback.print_exc()