mricon / b4

Tool to help with email-based patch workflows
GNU General Public License v2.0
59 stars 20 forks source link

mbox: remove "try: ... except: sys.exit(1)" wrapper in make_am() #17

Closed hnez closed 7 months ago

hnez commented 7 months ago

The try: ... except: sys.exit(1) mapper results in b4 exiting without any error message for a very broad range of exceptions. This is in general less helpful than an exception backtrace.

This came up when trying to use b4 without user.name and user.email entries in the git config and using GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL environment variables instead, because LoreTrailer.__init__() accesses the config keys without checking for their existence or falling back to the envrionment variables.

While LoreTrailer.__init__() should likely be changed as well to print an error if name or email are unconfigured and should also likely use the environment variables, this tackles the low hanging fruit first and makes finding the issue easier by printing a backtrace in this case.