blob: 029e1227647af4587182fcc58d8bd207628c4432 [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
20class EditorError(Exception):
21 """Unspecified error from the user's text editor.
22 """
23
24class GitError(Exception):
25 """Unspecified internal error from git.
26 """
27 def __init__(self, command):
28 self.command = command
29
30 def __str__(self):
31 return self.command
32
33class ImportError(Exception):
34 """An import from a non-Git format cannot be performed.
35 """
36 def __init__(self, reason):
37 self.reason = reason
38
39 def __str__(self):
40 return self.reason
41
42class UploadError(Exception):
43 """A bundle upload to Gerrit did not succeed.
44 """
45 def __init__(self, reason):
46 self.reason = reason
47
48 def __str__(self):
49 return self.reason
50
51class NoSuchProjectError(Exception):
52 """A specified project does not exist in the work tree.
53 """
54 def __init__(self, name=None):
55 self.name = name
56
57 def __str__(self):
58 if self.Name is None:
59 return 'in current directory'
60 return self.name
61
62class RepoChangedException(Exception):
63 """Thrown if 'repo sync' results in repo updating its internal
64 repo or manifest repositories. In this special case we must
65 use exec to re-execute repo with the new code and manifest.
66 """
Shawn O. Pearcec9ef7442008-11-03 10:32:09 -080067 def __init__(self, extra_args=[]):
68 self.extra_args = extra_args