-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.h
267 lines (232 loc) · 6.03 KB
/
exceptions.h
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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#ifndef EXCEPTIONS_H
#define EXCEPTIONS_H
#include <exception>
class SendRecvException : public std::exception {
public:
virtual const char * what() const throw()
{
return "send or recv failed";
}
};
class SendException : public std::exception {
public:
virtual const char * what() const throw()
{
return "send failed";
}
};
class RecvException : public std::exception {
public:
virtual const char * what() const throw()
{
return "recv failed";
}
};
class InconsistentTypeException : public std::exception {
public:
virtual const char * what() const throw()
{
return "type sent differs from type to receive to";
}
};
class TooManyPluginArchitectures : public std::exception {
public:
virtual const char * what() const throw()
{
return "too many plugin architectures created for the same thread\n";
}
};
class TooManyRequestHandlers : public std::exception {
public:
virtual const char * what() const throw()
{
return "trying to assign more than one request handler to a request\n";
}
};
class UnregisteringNotRegisterd : public std::exception {
public:
virtual const char * what() const throw()
{
return "trying to unregiser an unregistered handler\n";
}
};
class NoEventHandler : public std::exception {
public:
virtual const char * what() const throw()
{
return "trying to handle an event for which there is no handler\n";
}
};
class NoRequestHandler : public std::exception {
public:
virtual const char * what() const throw()
{
return "trying to handle a request for which there is no handler\n";
}
};
class TooLongString : public std::exception {
public:
virtual const char * what() const throw()
{
return "oh, come on - nobody sends strings as big as that!\n";
}
};
class UnknownEventNumber : public std::exception {
public:
virtual const char * what() const throw()
{
return "unknown event number, are you sending the event by hand?!\n";
}
};
class UnknownRequestNumber : public std::exception {
public:
virtual const char * what() const throw()
{
return "unknown request number, are you sending the request by hand?!\n";
}
};
class NullPointerException : public std::exception {
public:
virtual const char * what() const throw()
{
return "null pointer, duh\n";
}
};
class UnimplementedPluginMethod : public std::exception {
public:
virtual const char * what() const throw()
{
return "looks like you registered a method which you did not override\n";
}
};
class DeserializationMemoryInconsistencyException : public std::exception {
public:
virtual const char * what() const throw()
{
return "the block of memory is too short or corrupt\n";
}
};
class UnknownPluginException : public std::exception {
public:
virtual const char * what() const throw()
{
return "the plugin in the configure file is unknown\n";
}
};
class VSFPluginException : public std::exception {
public:
virtual const char * what() const throw() = 0;
};
class MySQLConnHostError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Failed connecting to the MySQL server\n";
}
};
class MySQLConnectionError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Failed connecting to the local MySQL server\n";
}
};
class MySQLCommandsOutOfSync : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: MySQL commands executed in an improper order\n";
}
};
class MySQLIpsockError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Failed to create an IP socket\n";
}
};
class MySQLOutOfMemory : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Out of ... I don't remember what... oh yes, memory\n";
}
};
class MySQLSocketCreateError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Failed to create a Unix socket\n";
}
};
class MySQLUnknownHost : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Unknown MySQL host, check your DNS settings\n";
}
};
class MySQLVersionError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Wrong MySQL version! Either the client is too old or the server is too new\n";
}
};
class MySQLNamedpipeopenError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Failed to create a named pipe on Windows\n";
}
};
class MySQLNamedpipewaitError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Failed to wait for a named pipe on Windows\n";
}
};
class MySQLNamedpipesetstateError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Failed to get pipe handler on Windows\n";
}
};
class MySQLServerLost : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Server Lost, connection to the server timed out\n";
}
};
class MySQLServerGoneError : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: MySQL server has gone... away\n";
}
};
class MySQLUnknown : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: Unknown Error code!\n";
}
};
class MySQLFileEntryNotFound : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFMySQL: File or directory not found in database! (or multiple instances of the same file/directory found)\n";
}
};
class PgSQLFileEntryNotFound : public VSFPluginException {
public:
virtual const char * what() const throw()
{
return "VSFPgSQL: File or directory not found in database! (or multiple instances of the same file/directory found)\n";
}
};
#endif //EXCEPTIONS_H