1 '''
2 # DESCRIPTION:
3 # Entropy exceptions class
4
5 Copyright (C) 2007-2009 Fabio Erculiani
6
7 structure inspired from portage_exception.py
8 Copyright 1998-2004 Gentoo Foundation
9 # $Id: portage_exception.py 6885 2007-06-20 05:45:31Z zmedico $
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 '''
25
26
28 """General superclass for Entropy exceptions"""
30 self.value = value[:]
31 Exception.__init__(self)
32
34 if isinstance(self.value, basestring):
35 return self.value
36 else:
37 return repr(self.value)
38
40 """Corruption indication"""
41
43 """On-Disk cache Corruption indication"""
44
46 """An invalid depend string has been encountered"""
47
49 """An invalid version string has been encountered"""
50
52 """An incorrect formatting was passed instead of the expected one"""
53
55 """A parameter of the wrong type was passed"""
56
58 """A parameter is required for the action requested but was not passed"""
59
61 """An error was generated while attempting to parse the request"""
62
64 """An incorrect formatting was passed instead of the expected one"""
65
67 """An incorrect type was passed instead of the expected one"""
68
70 """Cannot open repository database"""
71
73 """Cannot connect to service"""
74
76 """Raised to interrupt a thread or process"""
77
80
82 """Cannot open system database"""
83
85 """Source Package Manager generic errors"""
86
89
91 """Action queue issue"""
92
94 """
95 Data was not found when it was expected to exist or
96 was specified incorrectly
97 """
98
100 """Atom not properly formatted"""
101
103 """Package set does not exist"""
104
106 """A file was not found when it was expected to exist"""
107
109 """A directory was not found when it was expected to exist"""
110
112 """An operation was not permitted operating system"""
113
115 """Permission denied"""
116 from errno import EACCES as errno
117
119 """Read-only file system"""
120
122 """A required binary was not available or executable"""
123
125 """A required library was not available or executable"""
126
128 """SSL support is not available"""
129
131 """Malformed or missing package data"""
132