Coverage for /Users/OORDCOR/Documents/code/bump-my-version/bumpversion/exceptions.py: 100%
22 statements
« prev ^ index » next coverage.py v7.3.2, created at 2024-02-24 07:45 -0600
« prev ^ index » next coverage.py v7.3.2, created at 2024-02-24 07:45 -0600
1"""Custom exceptions for BumpVersion."""
3from typing import Optional
5from click import Context, UsageError
8class BumpVersionError(UsageError):
9 """Custom base class for all BumpVersion exception types."""
11 def __init__(self, message: str, ctx: Optional[Context] = None):
12 self.message = message
13 self.ctx = ctx
16class FormattingError(BumpVersionError):
17 """We are unable to represent a version required by a format."""
19 pass
22class MissingValueError(BumpVersionError):
23 """A part required for a version format is empty."""
25 pass
28class DirtyWorkingDirectoryError(BumpVersionError):
29 """The working directory is dirty, and it is not allowed."""
31 pass
34class SignedTagsError(BumpVersionError):
35 """The VCS does not support signed tags."""
37 pass
40class VersionNotFoundError(BumpVersionError):
41 """A version number was not found in a source file."""
43 pass
46class InvalidVersionPartError(BumpVersionError):
47 """The specified part (e.g. 'bugfix') was not found."""
49 pass
52class ConfigurationError(BumpVersionError):
53 """A configuration key-value is missing or in the wrong type."""
55 pass
58class BadInputError(BumpVersionError):
59 """User input was bad."""
61 pass