Coverage for /Users/OORDCOR/Documents/code/bump-my-version/bumpversion/exceptions.py: 91%
22 statements
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-15 09:15 -0600
« prev ^ index » next coverage.py v7.3.2, created at 2023-12-15 09:15 -0600
1"""Custom exceptions for BumpVersion."""
2from typing import Optional
4from click import Context, UsageError
7class BumpVersionError(UsageError):
8 """Custom base class for all BumpVersion exception types."""
10 def __init__(self, message: str, ctx: Optional[Context] = None):
11 self.message = message
12 self.ctx = ctx
15class FormattingError(BumpVersionError):
16 """We are unable to represent a version required by a format."""
18 pass
21class MissingValueError(BumpVersionError):
22 """A part required for a version format is empty."""
24 pass
27class DirtyWorkingDirectoryError(BumpVersionError):
28 """The working directory is dirty, and it is not allowed."""
30 pass
33class SignedTagsError(BumpVersionError):
34 """The VCS does not support signed tags."""
36 pass
39class VersionNotFoundError(BumpVersionError):
40 """A version number was not found in a source file."""
42 pass
45class InvalidVersionPartError(BumpVersionError):
46 """The specified part (e.g. 'bugfix') was not found."""
48 pass
51class ConfigurationError(BumpVersionError):
52 """A configuration key-value is missing or in the wrong type."""
54 pass
57class BadInputError(BumpVersionError):
58 """User input was bad."""
60 pass