-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexceptions.inc.php
189 lines (176 loc) · 4.45 KB
/
exceptions.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<?php
/**
* Exceptions used by the ActivePHP suite.
*
* @package ActivePHP
* @author OwlManAtt <[email protected]>
* @copyright 2007-2008, Yasashii Syndicate
* @version 2.4.0
**/
/**
* An exception to be thrown when the specified file is a blank and it is expected to be non-blank.
*
* @package ActivePHP
* @version Release: @package_version@
*/
class FileEmptyError extends Exception
{
/**
* Sets up the exception.
*
* @param string $message The error text.
* @param int $code An error code.
* @access private
* @return void
*/
public function __construct($message, $code = 0)
{
parent::__construct($message,$code);
}
/**
* Convert the exception into a string.
*
* @access private
* @return string
*/
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message} in '{$this->file}' on line {$this->line}.\n";
}
} // end FileEmptyError
/**
* An exception to be thrown when the specified file cannot be opened.
*
* @package ActivePHP
* @version Release: @package_version@
*/
class FileHandleError extends Exception
{
/**
* Sets up the exception.
*
* @param string $message The error text.
* @param int $code An error code.
* @access private
* @return void
*/
public function __construct($message, $code = 0)
{
parent::__construct($message,$code);
}
/**
* Convert the exception into a string.
*
* @access private
* @return string
*/
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message} in '{$this->file}' on line {$this->line}.\n";
}
} // end FileHandleError
/**
* An exception to be thrown when an argument is invalid.
*
* @package ActivePHP
* @version Release: @package_version@
*/
class ArgumentError extends Exception
{
/**
* Sets up the exception.
*
* @param string $message The error text.
* @param int $code An error code.
* @access private
* @return void
*/
public function __construct($message, $code = 0)
{
parent::__construct($message,$code);
}
/**
* Convert the exception into a string.
*
* @access private
* @return string
*/
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message} in '{$this->file}' on line {$this->line}.\n";
}
} // end ArgumentError
/**
* An exception to be thrown when there is an error in ActiveTable's SQL generation process.
*
* @package ActivePHP
* @version Release: @package_version@
*/
class SQLGenerationError extends Exception
{
/**
* Sets up the exception.
*
* @param string $message The error text.
* @param int $code An error code.
* @access private
* @return void
*/
public function __construct($message, $code = 0)
{
parent::__construct($message,$code);
}
/**
* Convert the exception into a string.
*
* @access private
* @return string
*/
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message} in '{$this->file}' on line {$this->line}.\n";
}
} // end SQLGenerationError
/**
* SQLError to be thrown when a query fails.
*
* @uses Exception
* @package ActivePHP
* @copyright 2007 Nicholas Evans
* @author Nick 'Owl' Evans <owlmanatt@gmail>
* @license http://www.gnu.org/licenses/gpl-3.0.txt GNU GPL v3
**/
class SQLError extends Exception
{
/**
* The offending SQL query.
*
* @access private
* @var string
*/
public $sql;
/**
* Sets up the exception.
*
* @param string $message The error text.
* @param string $sql The query that failed.
* @param int $code An error code.
* access private
* @return void
*/
public function __construct($message,$sql,$code = 0)
{
parent::__construct($message,$code);
$this->sql = $sql;
}
/**
* Convert the exception into a string.
*
* @return string
*/
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message} in '{$this->file}' on line {$this->line}. SQL specified was: {$this->sql}\n";
}
} // end SQLError
?>