source: indico/indico/MaKaC/errors.py @ 129c18

hello-world-walkthroughipv6v0.98-seriesv0.98.2v0.98.3v0.98b2v0.99v1.0v1.1
Last change on this file since 129c18 was 842982, checked in by Jose Benito <jose.benito.gonzalez@…>, 18 months ago

[FIX] Fixes on previous vidyo booking improvements

  • fixes for make me moderator, booking per contrib/session and access for creation
  • Property mode set to 100644
File size: 3.8 KB
Line 
1# -*- coding: utf-8 -*-
2##
3##
4## This file is part of CDS Indico.
5## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN.
6##
7## CDS Indico is free software; you can redistribute it and/or
8## modify it under the terms of the GNU General Public License as
9## published by the Free Software Foundation; either version 2 of the
10## License, or (at your option) any later version.
11##
12## CDS Indico is distributed in the hope that it will be useful, but
13## WITHOUT ANY WARRANTY; without even the implied warranty of
14## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15## General Public License for more details.
16##
17## You should have received a copy of the GNU General Public License
18## along with CDS Indico; if not, write to the Free Software Foundation, Inc.,
19## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
20
21"""
22Module containing the MaKaC exception class hierarchy
23"""
24
25class MaKaCError(Exception):
26
27    def __init__( self, msg="",area="", explanation = None):
28        self._msg = msg
29        self._area = area
30        self._explanation = explanation
31
32    def getMsg( self ):
33        return self._msg
34
35    def __str__(self):
36        if self._area != "":
37            return "%s - %s"%(self._area,self._msg)
38        else:
39            return self._msg
40
41    def getArea(self):
42        return self._area
43
44    def getExplanation(self):
45        """
46        Some extra information, like actions that can be taken
47        """
48
49        return self._explanation
50
51
52class AccessControlError(MaKaCError):
53    """
54    """
55    def __init__(self, objectType="object"):
56        self.objType = objectType
57
58    def __str__( self ):
59        return _("you are not authorised to access this %s")%self.objType
60
61
62class ConferenceClosedError(MaKaCError):
63    """
64    """
65    def __init__(self, conf):
66        self._conf = conf
67
68    def __str__( self ):
69        return _("the event has been closed")
70
71
72class DomainNotAllowedError(AccessControlError):
73
74    def __str__( self ):
75        return _("your domain is not allowed to acces this %s")%self.objType
76
77
78class AccessError(AccessControlError):
79    """
80    """
81    pass
82
83
84class KeyAccessError(AccessControlError):
85    """
86    """
87    pass
88
89
90class HostnameResolveError(MaKaCError):
91    """
92    Hostname resolution failed
93    """
94
95
96class ModificationError(AccessControlError):
97    """
98    """
99    def __str__( self ):
100        return _("you are not authorised to modify this %s")%self.objType
101
102
103class AdminError(AccessControlError):
104    """
105    """
106    def __str__(self):
107        return _("only administrators can access this %s")%self.objType
108
109
110class WebcastAdminError(AccessControlError):
111    """
112    """
113    def __str__(self):
114        return _("only webcast administrators can access this %s")%self.objType
115
116
117class TimingError(MaKaCError):
118    """
119    Timetable problems
120    """
121
122    def __init__(self, msg = "", area = "", explanation = None):
123        MaKaCError.__init__(self, msg, area, explanation)
124
125
126class ParentTimingError(TimingError):
127    """
128    """
129    pass
130
131
132class EntryTimingError(TimingError):
133    """
134    """
135    pass
136
137
138class UserError(MaKaCError):
139    """
140    """
141    def init(self, msg = ""):
142        self._msg = msg
143
144    def __str__(self):
145        if self._msg:
146            return self._msg
147        else:
148            return _("Error creating user")
149
150
151class FormValuesError(MaKaCError):
152    """
153    """
154    def __init__( self, msg="",area=""):
155        self._msg = msg
156        self._area = area
157
158
159class NoReportError(MaKaCError):
160    """
161    """
162    def __init__( self, msg="", area=""):
163        self._msg = msg
164        self._area = area
165
166class NotFoundError(MaKaCError):
167    """
168    """
169    def __init__( self, msg="", area=""):
170        self._msg = msg
171        self._area = area
172
173
174class PluginError(MaKaCError):
175    pass
176
177
178class HtmlScriptError(MaKaCError):
179    """
180    """
181    pass
182
183
184class HtmlForbiddenTag(MaKaCError):
185    """
186    """
187    pass
Note: See TracBrowser for help on using the repository browser.