source: trunk/error.py @ 273

Revision 273, 1.9 KB checked in by marc, 9 years ago (diff)

Better error handling for Py.2.6 and twisted

  • Property svn:keywords set to Id
Line 
1#! /usr/bin/env python
2# -*- coding: utf-8 -*-
3#
4# Itaka is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or
7# any later version.
8#
9# Itaka is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with Itaka; if not, write to the Free Software
16# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17#
18# Copyright 2003-2009 Marc E.
19# http://itaka.jardinpresente.com.ar
20#
21# $Id$
22
23""" Itaka exceptions """
24
25class ItakaError(Exception):
26    """
27    Base class for all Itaka errors
28    """
29
30    def __init__(self, value):
31        """
32        Constructor
33
34        @type value: str
35        @param value: Exception value
36        """
37
38        self.value = value
39
40    def __str__(self):
41        """
42        String representation
43
44        @rtype: str
45        @return: String representation of Exception value
46        """
47
48        return repr(self.value)
49
50
51class ItakaServerError(ItakaError):
52    """
53    Exception raised by server methods
54    """
55    pass
56
57
58class ItakaServerErrorCannotListen(ItakaServerError):
59    """
60    Exception raised by server methods
61    """
62    pass
63
64
65class ItakaScreenshotError(ItakaError):
66    """
67    Exception raised by screenshooting methods
68    """
69    pass
70
71
72class ItakaScreenshotErrorWmHints(ItakaScreenshotError):
73    """
74    Exception raised by screenshooting methods
75    """
76    pass
77
78
79class ItakaScreenshotErrorActiveDesktop(ItakaScreenshotError):
80    """
81    Exception raised by screenshooting methods
82    """
83    pass
84   
85
86class ItakaSaveScreenshotError(ItakaScreenshotError):
87    """
88    Exception raised by screenshooting methods
89    """
90    pass
91
Note: See TracBrowser for help on using the repository browser.