summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff-backup-statistics
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 /rdiff-backup/rdiff-backup-statistics
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
Diffstat (limited to 'rdiff-backup/rdiff-backup-statistics')
-rwxr-xr-xrdiff-backup/rdiff-backup-statistics19
1 files changed, 17 insertions, 2 deletions
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()