blob: 47d5cdfaf7e7a66bc66646cfa2c979e439fc62dd (
plain)
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
|
/*
* WAException.h
*
* Created on: 27/06/2012
* Author: Antonio
*/
#ifndef WAEXCEPTION_H_
#define WAEXCEPTION_H_
#include <stdexcept>
#include <string>
class WAException: public std::runtime_error {
public:
int type;
int subtype;
time_t expire_date; // in seconds
static const int LOGIN_FAILURE_EX = 1;
static const int LOGIN_FAILURE_EX_TYPE_PASSWORD = 0;
static const int LOGIN_FAILURE_EX_TYPE_EXPIRED = 1;
static const int CORRUPT_STREAM_EX = 2;
static const int SOCKET_EX = 3;
static const int SOCKET_EX_RESOLVE_HOST = 0;
static const int SOCKET_EX_OPEN = 1;
static const int SOCKET_EX_INIT = 2;
static const int SOCKET_EX_SEND = 3;
static const int SOCKET_EX_RECV = 4;
WAException(const std::string& err): runtime_error(err) {this->type = 0; this->subtype = 0; this->expire_date = 0;};
WAException(const std::string& err, int type, int subtype): runtime_error(err), type(type), subtype(subtype), expire_date(0) {};
WAException(const std::string& err, int type, int subtype, time_t expireDate): runtime_error(err), type(type), subtype(subtype), expire_date(expireDate) {};
};
#endif /* WAEXCEPTION_H_ */
|