]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- work on dbus interface
authorArvin Schnell <aschnell@suse.de>
Tue, 5 Jun 2012 15:00:56 +0000 (17:00 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 5 Jun 2012 15:00:56 +0000 (17:00 +0200)
client/snapper.cc
dbus/DBusMessage.h
server/snapperd.cc

index b5a324ef63513de30500fe4a7261ba38d8f3e744..4191c6db238ae3399fe126771c6adee3f4415d30 100644 (file)
@@ -1221,13 +1221,15 @@ main(int argc, char** argv)
     catch (const DBus::ErrorException& e)
     {
        if (strcmp(e.name(), "error.no_permissions") == 0)
-           cerr << "failed (no permissions)" << endl;
+           cerr << _("No permissions.") << endl;
+       else if (strcmp(e.name(), "error.invalid_userdata") == 0)
+           cerr << _("Invalid userdata.") << endl;
        else
-           cerr << "failed (" << e.what() << ")" << endl;
+           cerr << _("Failure") << " (" << e.what() << ")." << endl;
     }
     catch (const DBus::FatalException& e)
     {
-       cerr << "failed (" << e.what() << ")" << endl;
+       cerr << _("Failure") << " (" << e.what() << ")." << endl;
     }
 
     exit(EXIT_SUCCESS);
index b8f3ea48f48c5bf17047a13add562fab66cb3a45..0d865218b6113f523abf91ebd2855b17f575ab5e 100644 (file)
@@ -50,7 +50,7 @@ namespace DBus
     struct ErrorException : public Exception
     {
        explicit ErrorException(const DBusError err) throw() : err(err) {}
-       ~ErrorException() throw() { dbus_error_free(&err); }
+       virtual ~ErrorException() throw() { dbus_error_free(&err); }
        virtual const char* what() const throw() { return "dbus error exception"; }
        virtual const char* name() const throw() { return err.name; }
        virtual const char* message() const throw() { return err.message; }
index 6c8780f2bb54e868cee25e2778379e5fed097905..52f6665c2b4c27f0f60ba4e72c1894bf181b3e1b 100644 (file)
@@ -1068,6 +1068,11 @@ dispatch(DBus::Connection& conn, DBus::Message& msg)
        DBus::MessageError reply(msg, "error.illegal_snapshot", DBUS_ERROR_FAILED);
        conn.send(reply);
     }
+    catch (const InvalidUserdataException& e)
+    {
+       DBus::MessageError reply(msg, "error.invalid_userdata", DBUS_ERROR_FAILED);
+       conn.send(reply);
+    }
     catch (...)
     {
        DBus::MessageError reply(msg, "error.something", DBUS_ERROR_FAILED);