Module bzException
[frames] | no frames]

Source Code for Module bzException

 1  ##bzException.py defines BZoo exceptions. 
 2  ##Copyright (C) 2006  Jean-Baptiste PERIN 
 3  ## 
 4  ##This program is free software; you can redistribute it and/or 
 5  ##modify it under the terms of the GNU General Public License 
 6  ##as published by the Free Software Foundation; either version 2 
 7  ##of the License, or (at your option) any later version. 
 8  ## 
 9  ##This program 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 this program; if not, write to the Free Software 
16  ##Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
17  """ 
18   This module contains BZoo exceptions definition. (even we always hope that such a package will never be used) 
19  """ 
20   
21 -class BZooError(Exception):
22 """ 23 Exception occuring when ???. 24 @ivar value: the error message. 25 @type value: string. 26 """
27 - def __init__(self, value):
28 self.value = value
29 - def __str__(self):
30 return self.value
31
32 -class BZooProtocolError(Exception):
33 """ 34 Exception occuring when a protocol violation arises. 35 @ivar value: the error message. 36 @type value: string. 37 """
38 - def __init__(self, value):
39 self.value = value
40 - def __str__(self):
41 return "Unknown type of message %d."%self.value
42
43 -class BZooConnectionError(Exception):
44 """ 45 Exception occuring when a connection failure arises. 46 @ivar value: the error message. 47 @type value: string. 48 """
49 - def __init__(self, value):
50 self.value = value
51 - def __str__(self):
52 return "Unable to connect to server %s."%self.value
53