1 | # -*- coding: UTF-8 -*- |
---|
2 | # |
---|
3 | # PyKota : Print Quotas for CUPS |
---|
4 | # |
---|
5 | # (c) 2003, 2004, 2005, 2006, 2007, 2008 Jerome Alet <alet@librelogiciel.com> |
---|
6 | # This program is free software: you can redistribute it and/or modify |
---|
7 | # it under the terms of the GNU General Public License as published by |
---|
8 | # the Free Software Foundation, either version 3 of the License, or |
---|
9 | # (at your option) any later version. |
---|
10 | # |
---|
11 | # This program is distributed in the hope that it will be useful, |
---|
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | # GNU General Public License for more details. |
---|
15 | # |
---|
16 | # You should have received a copy of the GNU General Public License |
---|
17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
18 | # |
---|
19 | # $Id$ |
---|
20 | # |
---|
21 | |
---|
22 | """This module defines ALL PyKota specific exceptions.""" |
---|
23 | |
---|
24 | class PyKotaError(Exception) : |
---|
25 | """Mother class of all PyKota exceptions.""" |
---|
26 | def __init__(self, value) : |
---|
27 | """Saves the value passed as a parameter.""" |
---|
28 | self.value = value |
---|
29 | |
---|
30 | def __str__(self) : |
---|
31 | """Returns an unicode string representation.""" |
---|
32 | try : |
---|
33 | return unicode(self.value, errors="replace") |
---|
34 | except TypeError : |
---|
35 | return unicode(self.value) # None and strings which are already unicode |
---|
36 | |
---|
37 | class PyKotaToolError(PyKotaError) : |
---|
38 | """PyKota Exception for all executables.""" |
---|
39 | pass |
---|
40 | |
---|
41 | class PyKotaToolError(PyKotaError) : |
---|
42 | """PyKota Exception for all executables.""" |
---|
43 | pass |
---|
44 | |
---|
45 | class PyKotaCommandLineError(PyKotaToolError) : |
---|
46 | """PyKota Exception for errors on executables' command line.""" |
---|
47 | pass |
---|
48 | |
---|
49 | class PyKotaStorageError(PyKotaError) : |
---|
50 | """PyKota Exception for database backend related errors.""" |
---|
51 | pass |
---|
52 | |
---|
53 | class PyKotaConfigError(PyKotaError) : |
---|
54 | """PyKota Exception for errors in PyKota's configuration.""" |
---|
55 | pass |
---|
56 | |
---|
57 | class PyKotaAccounterError(PyKotaError) : |
---|
58 | """PyKota Exception for errors in PyKota accounters.""" |
---|
59 | pass |
---|
60 | |
---|
61 | class PyKotaReporterError(PyKotaError) : |
---|
62 | """PyKota Exception for errors in PyKota report generators.""" |
---|
63 | pass |
---|
64 | |
---|
65 | class PyKotaLoggingError(PyKotaError) : |
---|
66 | """PyKota Exception for errors in PyKota logging.""" |
---|
67 | pass |
---|