Commit ed70229b authored by Florian Pritz's avatar Florian Pritz
Browse files

Show exception stacktraces when we handle exceptions



For a KeyError, print(e) just prints the key name that wasn't found.
That's not even remotely helpful/obvious. Now we get a stacktrace and
the usual "KeyError: foo" message, which is much better and actually
what I wanted when I changed this.
Signed-off-by: Florian Pritz's avatarFlorian Pritz <bluewind@xinu.at>
parent 4482088d
......@@ -4,6 +4,7 @@ import sys
import os
import re
import tarfile
import traceback
import internetarchive as ia
......@@ -98,7 +99,7 @@ class ArchiveUploader:
returncode = 1
except Exception as e:
print(f"{identifier}: exception raised", file=sys.stderr)
print(e, file=sys.stderr)
print(traceback.format_exc(), file=sys.stderr)
print(directory)
returncode = 1
......@@ -126,7 +127,7 @@ class ArchiveUploader:
exitcode = 1
except Exception as e:
print(f"{identifier}: exception raised", file=sys.stderr)
print(e, file=sys.stderr)
print(traceback.format_exc(), file=sys.stderr)
print(pkg_dir)
exitcode = 1
return exitcode
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment