-
Notifications
You must be signed in to change notification settings - Fork 951
Expand file tree
/
Copy pathhserror.cpp
More file actions
49 lines (39 loc) · 948 Bytes
/
Copy pathhserror.cpp
File metadata and controls
49 lines (39 loc) · 948 Bytes
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
#include "acl_stdafx.hpp"
#ifndef ACL_PREPARE_COMPILE
#include "acl_cpp/hsocket/hserror.hpp"
#endif
#ifndef ACL_CLIENT_ONLY
namespace acl
{
static const char* dummy_unknown = "uknown error";
hserror::hserror(void)
{
}
hserror::~hserror(void)
{
}
const char* hserror::get_serror(int errnum)
{
static struct {
int err;
const char* msg;
} err_list[] = {
{ HS_ERR_INVALID_REPLY, "server reply invalid" },
{ HS_ERR_EMPTY, "server reply empty" },
{ HS_ERR_PARAMS, "params invalid" },
{ HS_ERR_NOT_OPEN, "server's table not open" },
{ HS_ERR_READ, "read from server error" },
{ HS_ERR_WRITE, "write to server error" },
{ HS_ERR_CONN, "connect server error" },
{ HS_ERR_OK, "ok" },
{ -1000, NULL}
};
for (int i = 0; err_list[i].msg != NULL; i++) {
if (err_list[i].err == errnum) {
return err_list[i].msg;
}
}
return dummy_unknown;
}
}
#endif // ACL_CLIENT_ONLY