The Android Open Source Project | cf31fe9 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | # |
| 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 | |
| 16 | class ManifestParseError(Exception): |
| 17 | """Failed to parse the manifest file. |
| 18 | """ |
| 19 | |
Shawn O. Pearce | 559b846 | 2009-03-02 12:56:08 -0800 | [diff] [blame] | 20 | class ManifestInvalidRevisionError(Exception): |
| 21 | """The revision value in a project is incorrect. |
| 22 | """ |
| 23 | |
The Android Open Source Project | cf31fe9 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 24 | class EditorError(Exception): |
| 25 | """Unspecified error from the user's text editor. |
| 26 | """ |
Shawn O. Pearce | 54fccd7 | 2009-06-24 07:09:51 -0700 | [diff] [blame] | 27 | def __init__(self, reason): |
| 28 | self.reason = reason |
| 29 | |
| 30 | def __str__(self): |
| 31 | return self.reason |
The Android Open Source Project | cf31fe9 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 32 | |
| 33 | class 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 | |
The Android Open Source Project | cf31fe9 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 42 | class 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 | |
Shawn O. Pearce | f322b9a | 2011-09-19 14:50:58 -0700 | [diff] [blame] | 51 | class DownloadError(Exception): |
| 52 | """Cannot download a repository. |
| 53 | """ |
| 54 | def __init__(self, reason): |
| 55 | self.reason = reason |
| 56 | |
| 57 | def __str__(self): |
| 58 | return self.reason |
| 59 | |
The Android Open Source Project | cf31fe9 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 60 | class NoSuchProjectError(Exception): |
| 61 | """A specified project does not exist in the work tree. |
| 62 | """ |
| 63 | def __init__(self, name=None): |
| 64 | self.name = name |
| 65 | |
| 66 | def __str__(self): |
| 67 | if self.Name is None: |
| 68 | return 'in current directory' |
| 69 | return self.name |
| 70 | |
Colin Cross | 5acde75 | 2012-03-28 20:15:45 -0700 | [diff] [blame] | 71 | |
| 72 | class InvalidProjectGroupsError(Exception): |
| 73 | """A specified project is not suitable for the specified groups |
| 74 | """ |
| 75 | def __init__(self, name=None): |
| 76 | self.name = name |
| 77 | |
| 78 | def __str__(self): |
| 79 | if self.Name is None: |
| 80 | return 'in current directory' |
| 81 | return self.name |
| 82 | |
The Android Open Source Project | cf31fe9 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 83 | class RepoChangedException(Exception): |
| 84 | """Thrown if 'repo sync' results in repo updating its internal |
| 85 | repo or manifest repositories. In this special case we must |
| 86 | use exec to re-execute repo with the new code and manifest. |
| 87 | """ |
David Pursehouse | 8a68ff9 | 2012-09-24 12:15:13 +0900 | [diff] [blame] | 88 | def __init__(self, extra_args=None): |
| 89 | self.extra_args = extra_args or [] |
Doug Anderson | 37282b4 | 2011-03-04 11:54:18 -0800 | [diff] [blame] | 90 | |
| 91 | class HookError(Exception): |
| 92 | """Thrown if a 'repo-hook' could not be run. |
| 93 | |
| 94 | The common case is that the file wasn't present when we tried to run it. |
| 95 | """ |
| 96 | pass |