Commit 4a8908ce authored by Guido Günther's avatar Guido Günther

Make it simple to print exception details

parent dacca59e
......@@ -18,6 +18,7 @@
import re
import os
import traceback
from gbp.errors import GbpError
from gbp.deb import DebianPkgPolicy
from gbp.pkg import Archive
......@@ -67,3 +68,8 @@ def get_component_tarballs(name, version, tarball, components):
if not os.path.exists(cname):
raise GbpError("Can not find component tarball %s" % cname)
return tarballs
def debug_exc(options):
if options.verbose:
traceback.print_exc()
......@@ -35,7 +35,7 @@ from gbp.git.vfs import GitVfs
from gbp.config import (GbpOptionParserDebian, GbpOptionGroup,
no_upstream_branch_msg)
from gbp.errors import GbpError
from gbp.scripts.common import ExitCodes
from gbp.scripts.common import ExitCodes, debug_exc
from gbp.scripts.common import repo_setup
import gbp.log
......@@ -534,9 +534,11 @@ def main(argv):
pass # command itself printed an error
except GitRepositoryError as msg:
gbp.log.err("Git command failed: %s" % msg)
debug_exc(options)
except GbpError as err:
if str(err):
gbp.log.err(err)
debug_exc(options)
except SkipImport:
skipped = True
ret = 0
......
Markdown is supported
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