blob: 812585cdd03cbd928921773f545bfce7aa2576d8 [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 """
Shawn O. Pearce54fccd72009-06-24 07:09:51 -070027 def __init__(self, reason):
28 self.reason = reason
29
30 def __str__(self):
31 return self.reason
The Android Open Source Projectcf31fe92008-10-21 07:00:00 -070032
33class GitError(Exception):
34 """Unspecified internal error from git.
35 """
36 def __init__(self, command):
37 self.command = command
38
39 def __str__(self):
40 return self.command
41
42class ImportError(Exception):
43 """An import from a non-Git format cannot be performed.
44 """
45 def __init__(self, reason):
46 self.reason = reason
47
48 def __str__(self):
49 return self.reason
50
51class UploadError(Exception):
52 """A bundle upload to Gerrit did not succeed.
53 """
54 def __init__(self, reason):
55 self.reason = reason
56
57 def __str__(self):
58 return self.reason
59
Shawn O. Pearcef322b9a2011-09-19 14:50:58 -070060class DownloadError(Exception):
61 """Cannot download a repository.
62 """
63 def __init__(self, reason):
64 self.reason = reason
65
66 def __str__(self):
67 return self.reason
68
The Android Open Source Projectcf31fe92008-10-21 07:00:00 -070069class NoSuchProjectError(Exception):
70 """A specified project does not exist in the work tree.
71 """
72 def __init__(self, name=None):
73 self.name = name
74
75 def __str__(self):
76 if self.Name is None:
77 return 'in current directory'
78 return self.name
79
80class RepoChangedException(Exception):
81 """Thrown if 'repo sync' results in repo updating its internal
82 repo or manifest repositories. In this special case we must
83 use exec to re-execute repo with the new code and manifest.
84 """
Shawn O. Pearcec9ef7442008-11-03 10:32:09 -080085 def __init__(self, extra_args=[]):
86 self.extra_args = extra_args
Doug Anderson37282b42011-03-04 11:54:18 -080087
88class HookError(Exception):
89 """Thrown if a 'repo-hook' could not be run.
90
91 The common case is that the file wasn't present when we tried to run it.
92 """
93 pass