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

Source Code for Module pysys.exceptions

 1  #!/usr/bin/env python 
 2  # PySys System Test Framework, Copyright (C) 2006-2016  M.B.Grieve 
 3   
 4  # This library is free software; you can redistribute it and/or 
 5  # modify it under the terms of the GNU Lesser General Public 
 6  # License as published by the Free Software Foundation; either 
 7  # version 2.1 of the License, or (at your option) any later version. 
 8   
 9  # This library 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 GNU 
12  # Lesser General Public License for more details. 
13   
14  # You should have received a copy of the GNU Lesser General Public 
15  # License along with this library; if not, write to the Free Software 
16  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 
17   
18  # Contact: moraygrieve@users.sourceforge.net 
19  """ 
20  Defines custom exceptions that can be thrown within the PySys framework.  
21   
22  """ 
23   
24 -class FileNotFoundException(Exception):
25 """Exception raised when a file cannot be found.""" 26
27 - def __init__(self,value):
28 self.value=value
29
30 - def __str__(self):
31 return self.value
32
33 -class IncorrectFileTypeException(Exception):
34 """Exception raised when the extension of a file is incorrect.""" 35
36 - def __init__(self,value):
37 self.value=value
38
39 - def __str__(self):
40 return self.value
41
42 -class ExecutableNotFoundException(Exception):
43 """Exception raised when an executable cannot be found.""" 44
45 - def __init__(self,value):
46 self.value=value
47
48 - def __str__(self):
49 return self.value
50
51 -class ProcessError(Exception):
52 """Exception raised when creating a process.""" 53
54 - def __init__(self,value):
55 self.value=value
56
57 - def __str__(self):
58 return self.value
59
60 -class ProcessTimeout(Exception):
61 """Exception raised when a process times out.""" 62
63 - def __init__(self,value):
64 self.value=value
65
66 - def __str__(self):
67 return self.value
68
69 -class InvalidDescriptorException(Exception):
70 """Exception raised when a testcase descriptor is invalid.""" 71
72 - def __init__(self,value):
73 self.value=value
74
75 - def __str__(self):
76 return self.value
77
78 -class InvalidXMLException(Exception):
79 """Exception raised when an input XML file is invalid.""" 80
81 - def __init__(self,value):
82 self.value=value
83
84 - def __str__(self):
85 return self.value
86
87 -class AbortExecution(Exception):
88 """Raised to abort execution of a test.""" 89
90 - def __init__(self, outcome, outcomeReason, callRecord=None):
91 self.outcome, self.value, self.callRecord = outcome, outcomeReason, callRecord
92
93 - def __str__(self):
94 return self.value
95