summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-11-12 21:37:29 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-11-12 21:37:29 +0000
commit63f29f5aa1d8fe0465a997bcdc628c055c02695b (patch)
tree49bee484c902a21c965123a11cec4294bdda9d08
parent6c992d8dfa30248857464729058c643c2f5c48b3 (diff)
downloadrdiff-backup-63f29f5aa1d8fe0465a997bcdc628c055c02695b.tar.gz
Print nicer error messages in rdiff-backup-statistics
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@960 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
-rw-r--r--rdiff-backup/CHANGELOG3
-rwxr-xr-xrdiff-backup/rdiff-backup-statistics19
2 files changed, 20 insertions, 2 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 089a709..68f9382 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,9 @@
New in v1.2.3 (????/??/??)
---------------------------
+Print nicer error messages in rdiff-backup-statistics (without tracebacks).
+Closes Ubuntu bug #292586. (Andrew Ferguson)
+
Properly handle EINVAL "Invalid argument" errors when setting extended
attributes. Thanks to Kevin Fenzi for reporting the issue. (Andrew Ferguson)
diff --git a/rdiff-backup/rdiff-backup-statistics b/rdiff-backup/rdiff-backup-statistics
index 9627e87..36a3ede 100755
--- a/rdiff-backup/rdiff-backup-statistics
+++ b/rdiff-backup/rdiff-backup-statistics
@@ -22,7 +22,7 @@
import os, sys, re, getopt
from rdiff_backup import connection, regress, rpath, Globals, restore, \
- Time, lazy, FilenameMapping
+ Time, lazy, FilenameMapping, robust
begin_time = None # Parse statistics at or after this time...
end_time = None # ... and at or before this time (epoch seconds)
@@ -443,5 +443,20 @@ def Main():
fst.print_top_dirs("increment size", lambda fs: fs.incsize)
fst.print_top_dirs("number of files changed", lambda fs: fs.changed)
-if __name__ == '__main__': Main()
+def error_check_Main():
+ """Run Main on arglist, suppressing stack trace for routine errors"""
+ try:
+ Main()
+ except SystemExit:
+ raise
+ except KeyboardInterrupt:
+ print "User abort"
+ except (Exception, KeyboardInterrupt), exc:
+ if robust.catch_error(exc):
+ print exc
+ else:
+ raise
+
+
+if __name__ == '__main__': error_check_Main()