blob: 6b9dff44a26470db3dfb87c8c9d40393a73fd1ac [file] [log] [blame]
The Android Open Source Projectcf31fe92008-10-21 07:00:00 -07001#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16class ManifestParseError(Exception):
17 """Failed to parse the manifest file.
18 """
19
Shawn O. Pearce559b8462009-03-02 12:56:08 -080020class ManifestInvalidRevisionError(Exception):
21 """The revision value in a project is incorrect.
22 """
23
The Android Open Source Projectcf31fe92008-10-21 07:00:00 -070024class EditorError(Exception):
25 """Unspecified error from the user's text editor.
26 """
27
28class GitError(Exception):
29 """Unspecified internal error from git.
30 """
31 def __init__(self, command):
32 self.command = command
33
34 def __str__(self):
35 return self.command
36
37class ImportError(Exception):
38 """An import from a non-Git format cannot be performed.
39 """
40 def __init__(self, reason):
41 self.reason = reason
42
43 def __str__(self):
44 return self.reason
45
46class UploadError(Exception):
47 """A bundle upload to Gerrit did not succeed.
48 """
49 def __init__(self, reason):
50 self.reason = reason
51
52 def __str__(self):
53 return self.reason
54
55class NoSuchProjectError(Exception):
56 """A specified project does not exist in the work tree.
57 """
58 def __init__(self, name=None):
59 self.name = name
60
61 def __str__(self):
62 if self.Name is None:
63 return 'in current directory'
64 return self.name
65
66class RepoChangedException(Exception):
67 """Thrown if 'repo sync' results in repo updating its internal
68 repo or manifest repositories. In this special case we must
69 use exec to re-execute repo with the new code and manifest.
70 """
Shawn O. Pearcec9ef7442008-11-03 10:32:09 -080071 def __init__(self, extra_args=[]):
72 self.extra_args = extra_args