diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
| commit | cf31fe9b4fb650b27e19f5d7ee7297e383660caf (patch) | |
| tree | d04ca6a45d579dca5e5469606c48c405aee68f4b /error.py | |
| download | git-repo-cf31fe9b4fb650b27e19f5d7ee7297e383660caf.tar.gz | |
Initial Contributionv1.0
Diffstat (limited to 'error.py')
| -rw-r--r-- | error.py | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/error.py b/error.py new file mode 100644 index 00000000..e3cf41c1 --- /dev/null +++ b/error.py | |||
| @@ -0,0 +1,66 @@ | |||
| 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 | |||
| 20 | class EditorError(Exception): | ||
| 21 | """Unspecified error from the user's text editor. | ||
| 22 | """ | ||
| 23 | |||
| 24 | class 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 | |||
| 33 | class 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 | |||
| 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 | |||
| 51 | class 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 | |||
| 62 | class 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 | """ | ||
