1"""Error definitions for SCMClient implementations."""
2
3from __future__ import unicode_literals
4
5
6class SCMError(Exception):
7    """A generic error from an SCM."""
8
9
10class AuthenticationError(Exception):
11    """An error for when authentication fails."""
12
13
14class CreateCommitError(Exception):
15    """The creation of a commit has failed or was aborted."""
16
17
18class MergeError(Exception):
19    """An error for when merging two branches fails."""
20
21
22class PushError(Exception):
23    """An error for when pushing a branch to upstream fails."""
24
25
26class AmendError(Exception):
27    """An error for when amending a commit fails."""
28
29
30class OptionsCheckError(Exception):
31    """An error for when command line options are used incorrectly."""
32
33
34class InvalidRevisionSpecError(Exception):
35    """An error for when the specified revisions are invalid."""
36
37
38class MinimumVersionError(Exception):
39    """An error for when software doesn't meet version requirements."""
40
41
42class TooManyRevisionsError(InvalidRevisionSpecError):
43    """An error for when too many revisions were specified."""
44
45    def __init__(self):
46        """Initialize the error."""
47        super(TooManyRevisionsError, self).__init__(
48            'Too many revisions specified')
49
50
51class EmptyChangeError(Exception):
52    """An error for when there are no changed files."""
53
54    def __init__(self):
55        """Initialize the error."""
56        super(EmptyChangeError, self).__init__(
57            "Couldn't find any affected files for this change.")
58