mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
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:
parent
4c03738938
commit
69fadc2de9
5 changed files with 34 additions and 19 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue