Fix catchall exceptions.

Using ValueError for everything caused underlying issues to be
hidden. Now there are explicit classes for each error condition.
This commit is contained in:
Manuel Barkhau 2019-03-28 23:37:58 +01:00
parent 4c03738938
commit 69fadc2de9
5 changed files with 34 additions and 19 deletions

View file

@ -224,7 +224,7 @@ def _bump(cfg: config.Config, new_version: str, allow_dirty: bool = False) -> No
try:
rewrite.rewrite(new_version, cfg.file_patterns)
except ValueError as ex:
except Exception as ex:
log.error(str(ex))
sys.exit(1)
@ -337,7 +337,7 @@ def bump(
if dry or verbose >= 2:
try:
_print_diff(cfg, new_version)
except ValueError as ex:
except Exception as ex:
log.error(str(ex))
sys.exit(1)