when verbose logging is enabled, print a traceback of possibly raised exceptions

This commit is contained in:
Johannes 'josch' Schauer 2016-02-14 18:55:27 +01:00
parent b6e969d267
commit c6d69b231b

View file

@ -1581,6 +1581,9 @@ values set via the --border option.
args.without_pdfrw, outputstream=args.output) args.without_pdfrw, outputstream=args.output)
except Exception as e: except Exception as e:
logging.error("error: " + str(e)) logging.error("error: " + str(e))
if logging.getLogger().isEnabledFor(logging.DEBUG):
import traceback
traceback.print_exc(file=sys.stderr)
exit(1) exit(1)
if __name__ == '__main__': if __name__ == '__main__':