]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- handle exception
authorArvin Schnell <aschnell@suse.de>
Fri, 7 Sep 2012 09:23:38 +0000 (11:23 +0200)
committerArvin Schnell <aschnell@suse.de>
Fri, 7 Sep 2012 09:23:38 +0000 (11:23 +0200)
client/snapper.cc
server/Client.cc

index 111a83288a0aecb830f463a115d4de7d362b86b6..7259f85d131c5eeada082158d2e59fdedb42891c 100644 (file)
@@ -1281,6 +1281,10 @@ main(int argc, char** argv)
            cerr << sformat(_("Creating config failed (%s)."), e.message()) << endl;
        else if (name == "error.delete_config_failed")
            cerr << sformat(_("Deleting config failed (%s)."), e.message()) << endl;
+       else if (name == "error.create_snapshot_failed")
+           cerr << _("Creating snapshot failed.") << endl;
+       else if (name == "error.delete_snapshot_failed")
+           cerr << _("Deleting snapshot failed.") << endl;
        else
            cerr << _("Failure") << " (" << name << ")." << endl;
        exit(EXIT_FAILURE);
index b847fcc51a389da75203401047221edffc3b0a2c..59cae4b0ad96eeaf8e0a412d41704960ce68c58b 100644 (file)
@@ -1173,6 +1173,16 @@ Client::dispatch(DBus::Connection& conn, DBus::Message& msg)
        DBus::MessageError reply(msg, "error.illegal_snapshot", DBUS_ERROR_FAILED);
        conn.send(reply);
     }
+    catch (const CreateSnapshotFailedException& e)
+    {
+       DBus::MessageError reply(msg, "error.create_snapshot_failed", DBUS_ERROR_FAILED);
+       conn.send(reply);
+    }
+    catch (const DeleteSnapshotFailedException& e)
+    {
+       DBus::MessageError reply(msg, "error.delete_snapshot_failed", DBUS_ERROR_FAILED);
+       conn.send(reply);
+    }
     catch (const UnknownFile& e)
     {
        DBus::MessageError reply(msg, "error.unknown_file", DBUS_ERROR_FAILED);