From 14d91a25fcfc68a16cfb29e8eb0ab203d4d236c0 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 1 Apr 2015 23:12:06 +0200 Subject: [PATCH] show tracebacks in top-level exception handler for easier debugging sure it is "prettier" without, but a lot of useful information for debugging is lost if the traceback is not shown. even for KeyboardInterrupt: it may have some bad reason when one has to use Ctrl-C - if attic was stuck somewhere, we want to know where it was. --- attic/archiver.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/attic/archiver.py b/attic/archiver.py index 47650c2d4..d3c8bb511 100644 --- a/attic/archiver.py +++ b/attic/archiver.py @@ -8,6 +8,7 @@ import os import stat import sys import textwrap +import traceback from attic import __version__ from attic.archive import Archive, ArchiveChecker @@ -726,9 +727,11 @@ def main(): try: exit_code = archiver.run(sys.argv[1:]) except Error as e: + traceback.print_exc() archiver.print_error(e.get_message()) exit_code = e.exit_code except KeyboardInterrupt: + traceback.print_exc() archiver.print_error('Error: Keyboard interrupt') exit_code = 1 else: