root / pykota / trunk / pykota / errors.py @ 3489

Revision 3489, 2.2 kB (checked in by jerome, 15 years ago)

Removed bad copy and paste artifact.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1# -*- coding: utf-8 -*-
2#
3# PyKota : Print Quotas for CUPS
4#
5# (c) 2003-2009 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
24class 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
37class PyKotaToolError(PyKotaError) :
38    """PyKota Exception for all executables."""
39    pass
40
41class PyKotaToolError(PyKotaError) :
42    """PyKota Exception for all executables."""
43    pass
44
45class PyKotaCommandLineError(PyKotaToolError) :
46    """PyKota Exception for errors on executables' command line."""
47    pass
48
49class PyKotaStorageError(PyKotaError) :
50    """PyKota Exception for database backend related errors."""
51    pass
52
53class PyKotaConfigError(PyKotaError) :
54    """PyKota Exception for errors in PyKota's configuration."""
55    pass
56
57class PyKotaAccounterError(PyKotaError) :
58    """PyKota Exception for errors in PyKota accounters."""
59    pass
60
61class PyKotaReporterError(PyKotaError) :
62    """PyKota Exception for errors in PyKota report generators."""
63    pass
64
65class PyKotaLoggingError(PyKotaError) :
66    """PyKota Exception for errors in PyKota logging."""
67    pass
68
69class PyKotaTimeoutError(PyKotaError) :
70    """An exception for timeouts."""
71    pass
Note: See TracBrowser for help on using the browser.