1 # Copyright 1998-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id: /var/cvsroot/gentoo-src/portage/pym/portage_exception.py,v 1.8.2.1 2005/01/16 02:35:33 carpaski Exp $
6 class PortageException(Exception):
7 """General superclass for portage exceptions"""
8 def __init__(self,value):
11 return repr(self.value)
13 class CorruptionError(PortageException):
14 """Corruption indication"""
16 class InvalidDependString(PortageException):
17 """An invalid depend string has been encountered"""
19 class InvalidVersionString(PortageException):
20 """An invalid version string has been encountered"""
22 class SecurityViolation(PortageException):
23 """An incorrect formatting was passed instead of the expected one"""
25 class IncorrectParameter(PortageException):
26 """A parameter of the wrong type was passed"""
28 class MissingParameter(PortageException):
29 """A parameter is required for the action requested but was not passed"""
31 class ParseError(PortageException):
32 """An error was generated while attempting to parse the request"""
34 class InvalidData(PortageException):
35 """An incorrect formatting was passed instead of the expected one"""
37 class InvalidDataType(PortageException):
38 """An incorrect type was passed instead of the expected one"""
40 class InvalidLocation(PortageException):
41 """Data was not found when it was expected to exist or was specified incorrectly"""
43 class FileNotFound(InvalidLocation):
44 """A file was not found when it was expected to exist"""
46 class DirectoryNotFound(InvalidLocation):
47 """A directory was not found when it was expected to exist"""
50 class CommandNotFound(PortageException):
51 """A required binary was not available or executable"""
54 class PortagePackageException(PortageException):
55 """Malformed or missing package data"""
57 class PackageNotFound(PortagePackageException):
58 """Missing Ebuild or Binary"""
60 class InvalidPackageName(PortagePackageException):
61 """Malformed package name"""
63 class InvalidAtom(PortagePackageException):
64 """Malformed atom spec"""
66 class UnsupportedAPIException(PortagePackageException):
68 def __init__(self, cpv, api):
69 self.cpv, self.api = cpv, api
71 return "Unable to do any operations on '%s', due to the fact it's EAPI is higher then this portage versions. Please upgrade to a portage version that supports EAPI %s" % (self.cpv, self.eapi)
75 class SignatureException(PortageException):
76 """Signature was not present in the checked file"""
78 class DigestException(SignatureException):
79 """A problem exists in the digest"""
81 class MissingSignature(SignatureException):
82 """Signature was not present in the checked file"""
84 class InvalidSignature(SignatureException):
85 """Signature was checked and was not a valid, current, nor trusted signature"""
87 class UntrustedSignature(SignatureException):
88 """Signature was not certified to the desired security level"""