From: Arvin Schnell Date: Fri, 7 Sep 2012 09:23:38 +0000 (+0200) Subject: - handle exception X-Git-Tag: v0.1.3~103 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=e28f8ef7405225ea0cc0ada890108f7a3a67497b;p=thirdparty%2Fsnapper.git - handle exception --- diff --git a/client/snapper.cc b/client/snapper.cc index 111a8328..7259f85d 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -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); diff --git a/server/Client.cc b/server/Client.cc index b847fcc5..59cae4b0 100644 --- a/server/Client.cc +++ b/server/Client.cc @@ -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);