Repository navigation
Expand file tree
/
Copy pathflow_exceptions.py
More file actions
165 lines (107 loc) · 3.33 KB
/
Copy pathflow_exceptions.py
File metadata and controls
165 lines (107 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#
# This file is part of `gitflow`.
# Copyright (c) 2010-2011 Vincent Driessen
# Copyright (c) 2012-2013 Hartmut Goebel
# Distributed under a BSD-like license. For full terms see the file LICENSE.txt
#
__copyright__ = "2010-2011 Vincent Driessen; 2012-2013 Hartmut Goebel"
__license__ = "BSD"
"""
This file contains all excpetions for the system. We are putting everything here
simply to make the code easier to navigate
"""
class GitflowError(Exception):
"""
This object is created like this to keep your try statements as easy as possible
if the exception that you get in your try statement is a derivative of GitFlowError,
you are assured that it is a Git Flow Plus application error and not some exception
thrown by a library or python itself
"""
pass
class ObjectError(GitflowError):
"""
The is a base object error. This base object indicates that exceptions is because
an object was expected and not recieved, wasn't initialized, or was in some other way
dirty.
"""
pass
class StateError(GitflowError):
"""
Base object error for the work flow system to indicate something was wrong with the state
"""
pass
class ConstError(GitflowError):
"""
This indicates that someone has tried to set the value of a constant twice.
"""
pass
class WorkflowInitializationError(StateError):
"""
indicates that the workflow system hasn't been issued a start state
"""
pass
class GitCommandError(GitflowError):
"""
this indicates that there was an error executing a git command within gitflow
"""
pass
class NotInitialized(GitflowError):
pass
class StatusError(GitflowError):
pass
class BranchExistsError(ObjectError):
pass
class BranchTypeExistsError(ObjectError):
def __str__(self):
return ("There is an existing %s branch. "
"Finish that one first." % self.args[0])
class MergeConflict(StatusError):
def __str__(self):
return '\n'.join([
"Merge conflicts not resolved yet, use:",
" git mergetool",
" git commit",
])
class NoSuchRemoteError(ObjectError):
pass
class NoSuchBranchError(ObjectError):
pass
class Usage(GitflowError):
def __str__(self):
return '\n'.join(map(str, self.args))
class BadObjectError(ObjectError):
pass
"""
class OperationsError(GitflowError):
pass
class PrefixNotUniqueError(OperationsError):
pass
class MergeError(OperationsError):
pass
class WorkdirIsDirtyError(StatusError):
pass
class AlreadyInitialized(StatusError):
def __str__(self):
return ("Already initialized for gitflow.\n"
"To force reinitialization use: git flow init -f")
class BaseNotOnBranch(ObjectError):
def __str__(self):
return ("Given base '%s' is not a valid commit on '%s'."
% (self.args[1], self.args[0]))
class BranchExistsError(ObjectError):
pass
class TagExistsError(ObjectError):
pass
class NoSuchLocalBranchError(NoSuchBranchError):
def __str__(self):
return "Local branch '%s' does not exist." % self.args[0]
"""
"""
Configuration Manager Exceptions
"""
class NoRepositoryObject(ObjectError):
"""
This is thrown indicating when an instance of the working repository was expected
and was not given
"""
pass