Package entropy :: Module exceptions

Source Code for Module entropy.exceptions

  1  # -*- coding: utf-8 -*- 
  2  """ 
  3   
  4      @author: Fabio Erculiani <lxnay@sabayonlinux.org> 
  5      @contact: lxnay@sabayonlinux.org 
  6      @copyright: Fabio Erculiani 
  7      @license: GPL-2 
  8   
  9      B{Entropy Framework exceptions class module} 
 10   
 11      This module contains Entropy Framework exceptions classes. 
 12   
 13  """ 
 14   
15 -class EntropyException(Exception):
16 """General superclass for Entropy exceptions"""
17 - def __init__(self, value):
18 self.value = value[:] 19 Exception.__init__(self)
20
21 - def __str__(self):
22 if isinstance(self.value, basestring): 23 return self.value 24 else: 25 return repr(self.value)
26
27 -class CorruptionError(EntropyException):
28 """Corruption indication"""
29
30 -class CacheCorruptionError(EntropyException):
31 """On-Disk cache Corruption indication"""
32
33 -class InvalidDependString(EntropyException):
34 """An invalid depend string has been encountered"""
35
36 -class InvalidVersionString(EntropyException):
37 """An invalid version string has been encountered"""
38
39 -class SecurityViolation(EntropyException):
40 """An incorrect formatting was passed instead of the expected one"""
41
42 -class IncorrectParameter(EntropyException):
43 """A parameter of the wrong type was passed"""
44
45 -class MissingParameter(EntropyException):
46 """A parameter is required for the action requested but was not passed"""
47
48 -class ParseError(EntropyException):
49 """An error was generated while attempting to parse the request"""
50
51 -class InvalidData(EntropyException):
52 """An incorrect formatting was passed instead of the expected one"""
53
54 -class InvalidDataType(EntropyException):
55 """An incorrect type was passed instead of the expected one"""
56
57 -class RepositoryError(EntropyException):
58 """Cannot open repository database"""
59
60 -class ConnectionError(EntropyException):
61 """Cannot connect to service"""
62
63 -class InterruptError(EntropyException):
64 """Raised to interrupt a thread or process"""
65
66 -class FtpError(EntropyException):
67 """FTP errors"""
68
69 -class SystemDatabaseError(EntropyException):
70 """Cannot open system database"""
71
72 -class SPMError(EntropyException):
73 """Source Package Manager generic errors"""
74
75 -class OnlineMirrorError(EntropyException):
76 """Mirror issue"""
77
78 -class QueueError(EntropyException):
79 """Action queue issue"""
80
81 -class InvalidLocation(EntropyException):
82 """ 83 Data was not found when it was expected to exist or 84 was specified incorrectly 85 """
86
87 -class InvalidAtom(EntropyException):
88 """Atom not properly formatted"""
89
90 -class InvalidPackageSet(EntropyException):
91 """Package set does not exist"""
92
93 -class FileNotFound(InvalidLocation):
94 """A file was not found when it was expected to exist"""
95
96 -class DirectoryNotFound(InvalidLocation):
97 """A directory was not found when it was expected to exist"""
98
99 -class OperationNotPermitted(EntropyException):
100 """An operation was not permitted operating system"""
101
102 -class PermissionDenied(EntropyException):
103 """Permission denied""" 104 from errno import EACCES as errno
105
106 -class ReadOnlyFileSystem(EntropyException):
107 """Read-only file system"""
108
109 -class CommandNotFound(EntropyException):
110 """A required binary was not available or executable"""
111
112 -class LibraryNotFound(EntropyException):
113 """A required library was not available or executable"""
114
115 -class SSLError(EntropyException):
116 """SSL support is not available"""
117
118 -class TimeoutError(EntropyException):
119 """Generic Timeout Error exception"""
120
121 -class EntropyPackageException(EntropyException):
122 """Malformed or missing package data"""
123