-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathxserver_response_code.cpp
More file actions
76 lines (75 loc) · 2.77 KB
/
xserver_response_code.cpp
File metadata and controls
76 lines (75 loc) · 2.77 KB
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
// Copyright (c) 2017-2018 Telos Foundation & contributors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "xserver_response_code.h"
namespace top
{
namespace httpserver
{
std::string xserver_response_code::to_string() const
{
std::string result;
switch (m_code)
{
case ok:
result = "ok";
break;
case json_parser_error:
result = "json parser error: ";
break;
case action_not_find:
result = "action is empty";
break;
case account_is_empty:
result = "account is empty";
break;
case property_key_is_empty:
result = "property_key is empty";
break;
case account_is_not_exist:
result = "account is not exist";
break;
case property_key_is_not_exist:
result = "property_key is not exist";
break;
case account_is_exist:
result = "account is exist";
break;
case signature_verify_fail:
result = "signature verify fail";
break;
case balance_is_not_enough:
result = "balance is not enough";
break;
case source_and_destination_same:
result = "source and destination is the same";
break;
case last_hash_is_not_equal:
result = "last_hash is not equal";
break;
case miss_parameter:
result = "miss parameter";
break;
case per_page_too_large:
result = "per_page too large";
break;
case property_key_not_valid:
result = "property_key not valid";
break;
case already_give:
result = "already give";
break;
case server_unknown_error:
result = "server unknown error";
break;
case request_time_out:
result = "request time out";
break;
default:
result = "Unknown code " + std::to_string(m_code);
break;
}
return result;
}
}
}