]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- improved error logging 811/head
authorArvin Schnell <aschnell@suse.de>
Tue, 25 Apr 2023 07:01:41 +0000 (09:01 +0200)
committerArvin Schnell <aschnell@suse.de>
Tue, 25 Apr 2023 07:01:41 +0000 (09:01 +0200)
client/GlobalOptions.cc
client/GlobalOptions.h
client/snapper.cc
dbus/DBusConnection.cc
dbus/DBusMainLoop.cc
dbus/DBusMessage.cc
dbus/DBusMessage.h
dbus/DBusPipe.cc
doc/snapper.xml.in
server/Client.cc
server/MetaSnapper.cc

index 966c1065955854940cf22b34f14a11ac8ca20bcb..eee8dc63bcfd64782f3abc37645201a564a02721 100644 (file)
@@ -40,6 +40,7 @@ namespace snapper
        return string(_("    Global options:")) + '\n'
            + _("\t--quiet, -q\t\t\tSuppress normal output.") + '\n'
            + _("\t--verbose, -v\t\t\tIncrease verbosity.") + '\n'
+           + _("\t--debug\t\t\t\tTurn on debugging.") + '\n'
            + _("\t--utc\t\t\t\tDisplay dates and times in UTC.") + '\n'
            + _("\t--iso\t\t\t\tDisplay dates and times in ISO format.") + '\n'
            + _("\t--table-style, -t <style>\tTable style (integer).") + '\n'
@@ -63,6 +64,7 @@ namespace snapper
        const vector<Option> options = {
            Option("quiet",             no_argument,            'q'),
            Option("verbose",           no_argument,            'v'),
+           Option("debug",             no_argument),
            Option("utc",               no_argument),
            Option("iso",               no_argument),
            Option("table-style",       required_argument,      't'),
@@ -86,6 +88,7 @@ namespace snapper
 
        _quiet = opts.has_option("quiet");
        _verbose = opts.has_option("verbose");
+       _debug = opts.has_option("debug");
        _utc = opts.has_option("utc");
        _iso = opts.has_option("iso");
        _no_dbus = opts.has_option("no-dbus");
index ed7300c6cf5700a83ef41bdef3bef858f046ed18..3fb6e1f1610a9741ac08137ba9ff9f5c4b056dc2 100644 (file)
@@ -47,6 +47,7 @@ namespace snapper
 
        bool quiet() const { return _quiet; }
        bool verbose() const { return _verbose; }
+       bool debug() const { return _debug; }
        bool utc() const { return _utc; }
        bool iso() const { return _iso; }
        bool no_dbus() const { return _no_dbus; }
@@ -76,6 +77,7 @@ namespace snapper
 
        bool _quiet;
        bool _verbose;
+       bool _debug;
        bool _utc;
        bool _iso;
        bool _no_dbus;
index 76021f225194a93aa7cdca87d4c9a5abfa37fa05..0381ac03aadd207fa7d0c9ff2005b0cfac57669d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) [2011-2015] Novell, Inc.
- * Copyright (c) [2016-2020] SUSE LLC
+ * Copyright (c) [2016-2023] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -71,6 +71,9 @@ struct Cmd
 };
 
 
+static bool log_debug = false;
+
+
 void
 log_do(LogLevel level, const string& component, const char* file, const int line, const char* func,
        const string& text)
@@ -82,7 +85,7 @@ log_do(LogLevel level, const string& component, const char* file, const int line
 bool
 log_query(LogLevel level, const string& component)
 {
-    return level == ERROR;
+    return log_debug || level == ERROR;
 }
 
 
@@ -167,6 +170,11 @@ main(int argc, char** argv)
 
        GlobalOptions global_options(get_opts);
 
+       if (global_options.debug())
+       {
+           log_debug = true;
+       }
+
        if (global_options.version())
        {
            cout << "snapper " << Snapper::compileVersion() << endl;
@@ -201,9 +209,13 @@ main(int argc, char** argv)
 
        try
        {
+           y2mil("constructing ProxySnapper object");
+
            ProxySnappers snappers(global_options.no_dbus() ? ProxySnappers::createLib(global_options.root()) :
                                   ProxySnappers::createDbus());
 
+           y2mil("executing command");
+
            if (cmd->needs_snapper)
                (*cmd->cmd_func)(global_options, get_opts, &snappers, snappers.getSnapper(global_options.config()));
            else
index 33ba6e7737013d9b2082825d405beb364e394cc7..74fb7f4426adb84aaa2f427f3e7f959fb180a8f3 100644 (file)
 
 
 #include <unistd.h>
-#include <stdlib.h>
+#include <cstdlib>
 #include <sys/types.h>
 #include <pwd.h>
 
 #include "DBusConnection.h"
 
+
 namespace DBus
 {
 
@@ -39,12 +40,12 @@ namespace DBus
        if (dbus_error_is_set(&err))
        {
            dbus_error_free(&err);
-           throw FatalException();
+           SN_THROW(FatalException());
        }
 
        if (!conn)
        {
-           throw FatalException();
+           SN_THROW(FatalException());
        }
     }
 
@@ -67,12 +68,12 @@ namespace DBus
        if (dbus_error_is_set(&err))
        {
            dbus_error_free(&err);
-           throw FatalException();
+           SN_THROW(FatalException());
        }
 
        if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER)
        {
-           throw FatalException();
+           SN_THROW(FatalException());
        }
     }
 
@@ -84,7 +85,7 @@ namespace DBus
 
        if (!dbus_connection_send(conn, m.get_message(), NULL))
        {
-           throw FatalException();
+           SN_THROW(FatalException());
        }
     }
 
@@ -101,7 +102,7 @@ namespace DBus
                                                                     0x7fffffff, &err);
        if (dbus_error_is_set(&err))
        {
-           throw ErrorException(err);
+           SN_THROW(ErrorException(err));
        }
 
        return Message(tmp, false);
@@ -120,7 +121,7 @@ namespace DBus
        if (dbus_error_is_set(&err))
        {
            dbus_error_free(&err);
-           throw FatalException();
+           SN_THROW(FatalException());
        }
     }
 
@@ -137,7 +138,7 @@ namespace DBus
        if (dbus_error_is_set(&err))
        {
            dbus_error_free(&err);
-           throw FatalException();
+           SN_THROW(FatalException());
        }
     }
 
@@ -158,7 +159,7 @@ namespace DBus
        string sender = m.get_sender();
        if (sender.empty())
        {
-           throw FatalException();
+           SN_THROW(FatalException());
        }
 
        DBusError err;
@@ -168,7 +169,7 @@ namespace DBus
        if (dbus_error_is_set(&err))
        {
            dbus_error_free(&err);
-           throw FatalException();
+           SN_THROW(FatalException());
        }
 
        return uid;
index 041326de9f0c79dc9f80944f2d1ceabeb59817a0..d839329593376fe3a141a357c25e773d1d16d52e 100644 (file)
@@ -55,15 +55,15 @@ namespace DBus
        : Connection(type), idle_timeout(-1)
     {
        if (pipe(wakeup_pipe) != 0)
-           throw FatalException();
+           SN_THROW(FatalException());
 
        if (!dbus_connection_set_watch_functions(conn, add_watch, remove_watch, toggled_watch,
                                                 this, NULL))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        if (!dbus_connection_set_timeout_functions(conn, add_timeout, remove_timeout,
                                                   toggled_timeout, this, NULL))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        dbus_connection_set_wakeup_main_function(conn, wakeup_main, this, NULL);
     }
@@ -116,7 +116,7 @@ namespace DBus
 
            int r = poll(&pollfds[0], pollfds.size(), timeout.count());
            if (r == -1)
-               throw FatalException();
+               SN_THROW(FatalException());
 
            periodic();
 
@@ -201,7 +201,7 @@ namespace DBus
            if (it->dbus_watch == dbus_watch)
                return it;
 
-       throw FatalException();
+       SN_THROW(FatalException());
     }
 
 
@@ -223,7 +223,7 @@ namespace DBus
            if (it->dbus_timeout == dbus_timeout)
                return it;
 
-       throw FatalException();
+       SN_THROW(FatalException());
     }
 
 
index 209e4413d4289698b77bee9c63aac0d7ac7a21ca..9b9ae20b9869fecb407c59701cb8b11b87e71394 100644 (file)
@@ -21,8 +21,8 @@
  */
 
 
-#include <assert.h>
-#include <stdlib.h>
+#include <cassert>
+#include <cstdlib>
 
 #include "DBusMessage.h"
 
@@ -74,7 +74,7 @@ namespace DBus
     {
        iters.push_back(new DBusMessageIter());
        if (!dbus_message_iter_init(msg.get_message(), top()))
-           throw FatalException();
+           SN_THROW(FatalException());
     }
 
 
@@ -123,7 +123,7 @@ namespace DBus
     {
        DBusMessageIter* iter2 = new DBusMessageIter();
        if (!dbus_message_iter_open_container(top(), DBUS_TYPE_STRUCT, NULL, iter2))
-           throw FatalException();
+           SN_THROW(FatalException());
        iters.push_back(iter2);
     }
 
@@ -134,7 +134,7 @@ namespace DBus
        DBusMessageIter* iter2 = top();
        iters.pop_back();
        if (!dbus_message_iter_close_container(top(), iter2))
-           throw FatalException();
+           SN_THROW(FatalException());
        delete iter2;
     }
 
@@ -144,7 +144,7 @@ namespace DBus
     {
        DBusMessageIter* iter2 = new DBusMessageIter();
        if (!dbus_message_iter_open_container(top(), DBUS_TYPE_ARRAY, signature, iter2))
-           throw FatalException();
+           SN_THROW(FatalException());
        iters.push_back(iter2);
     }
 
@@ -155,7 +155,7 @@ namespace DBus
        DBusMessageIter* iter2 = top();
        iters.pop_back();
        if (!dbus_message_iter_close_container(top(), iter2))
-           throw FatalException();
+           SN_THROW(FatalException());
        delete iter2;
     }
 
@@ -165,7 +165,7 @@ namespace DBus
     {
        DBusMessageIter* iter2 = new DBusMessageIter();
        if (!dbus_message_iter_open_container(top(), DBUS_TYPE_DICT_ENTRY, 0, iter2))
-           throw FatalException();
+           SN_THROW(FatalException());
        iters.push_back(iter2);
     }
 
@@ -176,7 +176,7 @@ namespace DBus
        DBusMessageIter* iter2 = top();
        iters.pop_back();
        if (!dbus_message_iter_close_container(top(), iter2))
-           throw FatalException();
+           SN_THROW(FatalException());
        delete iter2;
     }
 
@@ -185,7 +185,7 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, bool& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_BOOLEAN)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        dbus_bool_t tmp;
        dbus_message_iter_get_basic(unmarshaller.top(), &tmp);
@@ -201,7 +201,7 @@ namespace DBus
     {
        dbus_bool_t tmp = data;
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_BOOLEAN, &tmp))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -211,7 +211,7 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, dbus_uint16_t& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_UINT16)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        dbus_message_iter_get_basic(unmarshaller.top(), &data);
        dbus_message_iter_next(unmarshaller.top());
@@ -224,7 +224,7 @@ namespace DBus
     operator<<(Marshaller& marshaller, dbus_uint16_t data)
     {
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UINT16, &data))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -234,7 +234,7 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, dbus_uint32_t& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_UINT32)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        dbus_message_iter_get_basic(unmarshaller.top(), &data);
        dbus_message_iter_next(unmarshaller.top());
@@ -247,7 +247,7 @@ namespace DBus
     operator<<(Marshaller& marshaller, dbus_uint32_t data)
     {
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UINT32, &data))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -257,7 +257,7 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, dbus_uint64_t& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_UINT64)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        dbus_message_iter_get_basic(unmarshaller.top(), &data);
        dbus_message_iter_next(unmarshaller.top());
@@ -270,7 +270,7 @@ namespace DBus
     operator<<(Marshaller& marshaller, dbus_uint64_t data)
     {
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UINT64, &data))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -280,7 +280,7 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, time_t& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_INT64)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        dbus_uint64_t tmp;
        dbus_message_iter_get_basic(unmarshaller.top(), &tmp);
@@ -296,7 +296,7 @@ namespace DBus
     {
        dbus_uint64_t tmp = data;
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_INT64, &tmp))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -306,7 +306,7 @@ namespace DBus
     operator<<(Marshaller& marshaller, const char* data)
     {
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_STRING, &data))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -322,7 +322,7 @@ namespace DBus
            if (*it == '\\')
            {
                if (++it == in.end())
-                   throw MarshallingException();
+                   SN_THROW(MarshallingException());
 
                if (*it == '\\')
                {
@@ -334,7 +334,7 @@ namespace DBus
                    for (int i = 0; i < 2; ++i)
                    {
                        if (++it == in.end() || !isxdigit(*it))
-                           throw MarshallingException();
+                           SN_THROW(MarshallingException());
                        t1 += *it;
                    }
 
@@ -344,7 +344,7 @@ namespace DBus
                }
                else
                {
-                   throw MarshallingException();
+                   SN_THROW(MarshallingException());
                }
            }
            else
@@ -361,7 +361,7 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, string& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_STRING)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        const char* p = NULL;
        dbus_message_iter_get_basic(unmarshaller.top(), &p);
@@ -405,7 +405,7 @@ namespace DBus
        string tmp = marshaller.escape(data);
        const char* p = tmp.c_str();
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_STRING, &p))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -415,14 +415,14 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, map<string, string>& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_ARRAY)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        unmarshaller.open_recurse();
 
        while (unmarshaller.get_type() != DBUS_TYPE_INVALID)
        {
            if (unmarshaller.get_signature() != "{ss}")
-               throw MarshallingException();
+               SN_THROW(MarshallingException());
 
            unmarshaller.open_recurse();
 
index 5b0abfb7a9af64162e707978cd131cfac74225d8..b54e5f34710ac5a4fdfe40bfd07ca7fcffccafbf 100644 (file)
@@ -35,6 +35,9 @@
 #include "snapper/Exception.h"
 
 
+using namespace snapper;
+
+
 namespace DBus
 {
     using std::string;
@@ -53,9 +56,9 @@ namespace DBus
     {
        explicit ErrorException(const DBusError err)
            : Exception("dbus error exception"), err(err) {}
-       virtual ~ErrorException() throw() { dbus_error_free(&err); }
-       virtual const char* name() const throw() { return err.name; }
-       virtual const char* message() const throw() { return err.message; }
+       virtual ~ErrorException() { dbus_error_free(&err); }
+       virtual const char* name() const { return err.name; }
+       virtual const char* message() const { return err.message; }
        DBusError err;
     };
 
@@ -129,7 +132,7 @@ namespace DBus
            : Message(dbus_message_new_method_return(m.get_message()), false)
        {
            if (m.get_type() != DBUS_MESSAGE_TYPE_METHOD_CALL)
-               throw FatalException();
+               SN_THROW(FatalException());
        }
 
     };
@@ -143,7 +146,7 @@ namespace DBus
            : Message(dbus_message_new_error(m.get_message(), error_msg, error_code), false)
        {
            if (m.get_type() != DBUS_MESSAGE_TYPE_METHOD_CALL)
-               throw FatalException();
+               SN_THROW(FatalException());
        }
 
     };
@@ -251,14 +254,14 @@ namespace DBus
     Unmarshaller& operator>>(Unmarshaller& unmarshaller, vector<Type>& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_ARRAY)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        unmarshaller.open_recurse();
 
        while (unmarshaller.get_type() != DBUS_TYPE_INVALID)
        {
            if (unmarshaller.get_signature() != TypeInfo<Type>::signature)
-               throw MarshallingException();
+               SN_THROW(MarshallingException());
 
            Type tmp;
            unmarshaller >> tmp;
index ad41498e10173d0ead8c6ec44ca9232909171ee1..691975eb4bf4da08fe8ba8869b2b8a855096e5bb 100644 (file)
@@ -44,7 +44,7 @@ namespace DBus
     operator>>(Unmarshaller& unmarshaller, FileDescriptor& data)
     {
        if (unmarshaller.get_type() != DBUS_TYPE_UNIX_FD)
-           throw MarshallingException();
+           SN_THROW(MarshallingException());
 
        int fd;
        dbus_message_iter_get_basic(unmarshaller.top(), &fd);
@@ -60,7 +60,7 @@ namespace DBus
     {
        const int fd = data.get_fd();
        if (!dbus_message_iter_append_basic(marshaller.top(), DBUS_TYPE_UNIX_FD, &fd))
-           throw FatalException();
+           SN_THROW(FatalException());
 
        return marshaller;
     }
@@ -71,7 +71,7 @@ namespace DBus
        int pipefd[2];
 
        if (pipe2(pipefd, O_CLOEXEC) != 0)
-           throw PipeException();
+           SN_THROW(PipeException());
 
        _read_end.set_fd(pipefd[0]);
        _write_end.set_fd(pipefd[1]);
index b38574d4b89ebaa474d16f52eaaba4ee4b4309ef..0ac3ea2188a747b7a34e396af2951f803b1be7a9 100644 (file)
          <para>Increase verbosity.</para>
        </listitem>
       </varlistentry>
+      <varlistentry>
+       <term><option>--debug</option></term>
+       <listitem>
+         <para>Turn on debugging.</para>
+       </listitem>
+      </varlistentry>
       <varlistentry>
        <term><option>--utc</option></term>
        <listitem>
index 066d3d6e7fdb3508dbbdacf8539544713c3475e8..f5a2fc6efcc00344a3eae4523ceeb6309d0a029c 100644 (file)
@@ -91,7 +91,7 @@ Client::find_comparison(Snapper* snapper, Snapshots::const_iterator snapshot1,
            return it;
     }
 
-    throw NoComparison();
+    SN_THROW(NoComparison());
 }
 
 
@@ -424,7 +424,7 @@ Client::check_permission(DBus::Connection& conn, DBus::Message& msg) const
     if (uid == 0)
        return;
 
-    throw Permissions();
+    SN_THROW(Permissions());
 }
 
 
@@ -458,7 +458,7 @@ Client::check_permission(DBus::Connection& conn, DBus::Message& msg,
                return;
     }
 
-    throw Permissions();
+    SN_THROW(Permissions());
 }
 
 
@@ -477,7 +477,7 @@ Client::check_lock(DBus::Connection& conn, DBus::Message& msg, const string& con
            continue;
 
        if (it->has_lock(config_name))
-           throw Lock();
+           SN_THROW(Lock());
     }
 }
 
@@ -498,7 +498,7 @@ void
 Client::check_config_in_use(const MetaSnapper& meta_snapper) const
 {
     if (meta_snapper.use_count() != 0)
-       throw ConfigInUse();
+       SN_THROW(ConfigInUse());
 }
 
 
@@ -511,7 +511,7 @@ Client::check_snapshot_in_use(const MetaSnapper& meta_snapper, unsigned int numb
            it1->mounts.find(make_pair(meta_snapper.configName(), number));
 
        if (it2 != it1->mounts.end())
-           throw SnapshotInUse();
+           SN_THROW(SnapshotInUse());
     }
 }
 
@@ -853,7 +853,7 @@ Client::get_snapshot(DBus::Connection& conn, DBus::Message& msg)
 
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     DBus::MessageMethodReturn reply(msg);
 
@@ -887,7 +887,7 @@ Client::set_snapshot(DBus::Connection& conn, DBus::Message& msg)
 
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     snapper->modifySnapshot(snap, smd);
 
@@ -1145,7 +1145,7 @@ Client::is_snapshot_read_only(DBus::Connection& conn, DBus::Message& msg)
 
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     bool read_only = snap->isReadOnly();
 
@@ -1182,7 +1182,7 @@ Client::set_snapshot_read_only(DBus::Connection& conn, DBus::Message& msg)
 
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     snap->setReadOnly(read_only);
 
@@ -1309,7 +1309,7 @@ Client::get_used_space(DBus::Connection& conn, DBus::Message& msg)
 
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     uint64_t used_space = snap->getUsedSpace();
 
@@ -1346,7 +1346,7 @@ Client::mount_snapshot(DBus::Connection& conn, DBus::Message& msg)
 
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     snap->mountFilesystemSnapshot(user_request);
 
@@ -1388,7 +1388,7 @@ Client::umount_snapshot(DBus::Connection& conn, DBus::Message& msg)
 
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     snap->umountFilesystemSnapshot(user_request);
 
@@ -1422,7 +1422,7 @@ Client::get_mount_point(DBus::Connection& conn, DBus::Message& msg)
     Snapshots& snapshots = snapper->getSnapshots();
     Snapshots::iterator snap = snapshots.find(num);
     if (snap == snapshots.end())
-       throw IllegalSnapshotException();
+       SN_THROW(IllegalSnapshotException());
 
     string mount_point = snap->snapshotDir();
 
index bd3e76113dbcf99adef4dc6d2080c2e59edb1b7f..46446d654241f200bbcb8e2a0926796715637e03 100644 (file)
@@ -156,7 +156,7 @@ MetaSnappers::find(const string& config_name)
        if (it->configName() == config_name)
            return it;
 
-    throw UnknownConfig();
+    SN_THROW(UnknownConfig());
 }