]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- improved error messages (bsc#889928 and bsc#903834)
authorArvin Schnell <aschnell@suse.de>
Fri, 12 Dec 2014 09:35:56 +0000 (10:35 +0100)
committerArvin Schnell <aschnell@suse.de>
Fri, 12 Dec 2014 09:35:56 +0000 (10:35 +0100)
client/misc.cc
client/snapper.cc
package/snapper.changes

index a8f3e0d3ac013fc2057a3789334110825121243f..1eb8ebd5979dbce00ff8cc999096161cb70e4592 100644 (file)
@@ -83,6 +83,13 @@ read_nums(const string& str, const string& delim)
     string::size_type pos = str.find(delim);
     if (pos == string::npos)
     {
+       if (delim == "..")
+       {
+           cerr << _("Did not find delimiter '..' between snapshot numbers.") << endl
+                << _("See 'man snapper' for further instructions.") << endl;
+           exit(EXIT_FAILURE);
+       }
+
        cerr << _("Invalid snapshots.") << endl;
        exit(EXIT_FAILURE);
     }
index 3599c1be467c1f5015dc49a4f4dfe57a753157c5..f9382a75496e60cca9c4363ae49a7498acf1467c 100644 (file)
@@ -967,6 +967,13 @@ command_status(DBus::Connection* conn, Snapper* snapper)
     if (getopts.numArgs() != 1)
     {
        cerr << _("Command 'status' needs one argument.") << endl;
+
+       if (getopts.numArgs() == 2)
+       {
+           cerr << _("Maybe you forgot the delimiter '..' between the snapshot numbers.") << endl
+                << _("See 'man snapper' for further instructions.") << endl;
+       }
+
        exit(EXIT_FAILURE);
     }
 
@@ -1738,6 +1745,13 @@ main(int argc, char** argv)
        }
        catch (const DBus::ErrorException& e)
        {
+           if (strcmp(e.name(), "error.unknown_config") == 0 && config_name == "root")
+           {
+               cerr << _("The config 'root' does not exist. Likely snapper is not configured.") << endl
+                    << _("See 'man snapper' for further instructions.") << endl;
+               exit(EXIT_FAILURE);
+           }
+
            cerr << error_description(e) << endl;
            exit(EXIT_FAILURE);
        }
index b9aad17f69c629fa95c0cf77bbd09ac3854b7791..f4b152164d11f2f7e66ffca263b1c060bd48d266 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Fri Dec 12 10:34:37 CET 2014 - aschnell@suse.de
+
+- improved error messages (bsc#889928 and bsc#903834)
+
 -------------------------------------------------------------------
 Thu Dec 11 17:58:14 CET 2014 - aschnell@suse.de