From: Arvin Schnell Date: Fri, 12 Dec 2014 09:35:56 +0000 (+0100) Subject: - improved error messages (bsc#889928 and bsc#903834) X-Git-Tag: v0.2.5~4^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc2a0e72642c8db7e05b41979c5ef2ee0aab40ac;p=thirdparty%2Fsnapper.git - improved error messages (bsc#889928 and bsc#903834) --- diff --git a/client/misc.cc b/client/misc.cc index a8f3e0d3..1eb8ebd5 100644 --- a/client/misc.cc +++ b/client/misc.cc @@ -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); } diff --git a/client/snapper.cc b/client/snapper.cc index 3599c1be..f9382a75 100644 --- a/client/snapper.cc +++ b/client/snapper.cc @@ -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); } diff --git a/package/snapper.changes b/package/snapper.changes index b9aad17f..f4b15216 100644 --- a/package/snapper.changes +++ b/package/snapper.changes @@ -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