From add2853f92fc45d2b892ac76ac3c8659fc404cc8 Mon Sep 17 00:00:00 2001 From: owsla Date: Fri, 19 Dec 2008 14:55:38 +0000 Subject: Print a more helpful error message if we cannot read the backup destination. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@973 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/Main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/rdiff-backup/rdiff_backup/Main.py b/rdiff-backup/rdiff_backup/Main.py index f522a1d..c9118bf 100644 --- a/rdiff-backup/rdiff_backup/Main.py +++ b/rdiff-backup/rdiff_backup/Main.py @@ -704,8 +704,13 @@ def require_root_set(rp, read_only): if not restore_set_root(rp): Log.FatalError(("Bad directory %s.\n" % (rp.path,)) + "It doesn't appear to be an rdiff-backup destination dir") - Globals.rbdir.conn.fs_abilities.single_set_globals(Globals.rbdir, - read_only) + try: + Globals.rbdir.conn.fs_abilities.single_set_globals(Globals.rbdir, + read_only) + except IOError, exc: + print("\n") + Log.FatalError("Could not open rdiff-backup directory\n\n%s\n\n" + "due to\n\n%s" % (Globals.rbdir.path, exc)) if Globals.chars_to_quote: return restore_init_quoting(rp) else: return rp -- cgit v1.2.1