Package common :: Module exceptions
[hide private]
[frames] | no frames]

Source Code for Module common.exceptions

  1  # -*- coding:utf-8 -*- 
  2  ## src/common/exceptions.py 
  3  ## 
  4  ## Copyright (C) 2005-2006 Nikos Kouremenos <kourem AT gmail.com> 
  5  ## Copyright (C) 2005-2010 Yann Leboulanger <asterix AT lagaule.org> 
  6  ## Copyright (C) 2006 Jean-Marie Traissard <jim AT lapin.org> 
  7  ## Copyright (C) 2007 Brendan Taylor <whateley AT gmail.com> 
  8  ## 
  9  ## This file is part of Gajim. 
 10  ## 
 11  ## Gajim is free software; you can redistribute it and/or modify 
 12  ## it under the terms of the GNU General Public License as published 
 13  ## by the Free Software Foundation; version 3 only. 
 14  ## 
 15  ## Gajim is distributed in the hope that it will be useful, 
 16  ## but WITHOUT ANY WARRANTY; without even the implied warranty of 
 17  ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
 18  ## GNU General Public License for more details. 
 19  ## 
 20  ## You should have received a copy of the GNU General Public License 
 21  ## along with Gajim. If not, see <http://www.gnu.org/licenses/>. 
 22  ## 
 23   
24 -class PysqliteOperationalError(Exception):
25 """ 26 Sqlite2 raised pysqlite2.dbapi2.OperationalError 27 """ 28
29 - def __init__(self, text=''):
30 Exception.__init__(self) 31 self.text = text
32
33 - def __str__(self):
34 return self.text
35
36 -class DatabaseMalformed(Exception):
37 """ 38 The databas can't be read 39 """ 40
41 - def __init__(self):
42 Exception.__init__(self)
43
44 - def __str__(self):
45 return _('Database cannot be read.')
46
47 -class ServiceNotAvailable(Exception):
48 """ 49 This exception is raised when we cannot use Gajim remotely' 50 """ 51
52 - def __init__(self):
53 Exception.__init__(self)
54
55 - def __str__(self):
56 return _('Service not available: Gajim is not running, or remote_control is False')
57
58 -class DbusNotSupported(Exception):
59 """ 60 D-Bus is not installed or python bindings are missing 61 """ 62
63 - def __init__(self):
64 Exception.__init__(self)
65
66 - def __str__(self):
67 return _('D-Bus is not present on this machine or python module is missing')
68
69 -class SessionBusNotPresent(Exception):
70 """ 71 This exception indicates that there is no session daemon 72 """ 73
74 - def __init__(self):
75 Exception.__init__(self)
76
77 - def __str__(self):
78 return _('Session bus is not available.\nTry reading %(url)s') % \ 79 {'url': 'http://trac.gajim.org/wiki/GajimDBus'}
80
81 -class SystemBusNotPresent(Exception):
82 """ 83 This exception indicates that there is no session daemon 84 """ 85
86 - def __init__(self):
87 Exception.__init__(self)
88
89 - def __str__(self):
90 return _('System bus is not available.\nTry reading %(url)s') % \ 91 {'url': 'http://trac.gajim.org/wiki/GajimDBus'}
92
93 -class NegotiationError(Exception):
94 """ 95 A session negotiation failed 96 """ 97 pass
98
99 -class DecryptionError(Exception):
100 """ 101 A message couldn't be decrypted into usable XML 102 """ 103 pass
104
105 -class Cancelled(Exception):
106 """ 107 The user cancelled an operation 108 """ 109 pass
110
111 -class LatexError(Exception):
112 """ 113 LaTeX processing failed for some reason 114 """ 115
116 - def __init__(self, text=''):
117 Exception.__init__(self) 118 self.text = text
119
120 - def __str__(self):
121 return self.text
122
123 -class GajimGeneralException(Exception):
124 """ 125 This exception is our general exception 126 """ 127
128 - def __init__(self, text=''):
129 Exception.__init__(self) 130 self.text = text
131
132 - def __str__(self):
133 return self.text
134