@@ -31,18 +31,14 @@ class CSTATUS {
31
31
public:
32
32
explicit CSTATUS () = default;
33
33
34
- explicit CSTATUS (const std::string &errorInfo,
35
- const std::string &locateInfo = CGRAPH_EMPTY) {
34
+ explicit CSTATUS (const std::string &errorInfo) {
36
35
this ->error_code_ = STATUS_ERR; // 默认的error code信息
37
36
this ->error_info_ = errorInfo;
38
- this ->error_locate_ = locateInfo;
39
37
}
40
38
41
- explicit CSTATUS (int errorCode, const std::string &errorInfo,
42
- const std::string &locateInfo = CGRAPH_EMPTY) {
39
+ explicit CSTATUS (int errorCode, const std::string &errorInfo) {
43
40
this ->error_code_ = errorCode;
44
41
this ->error_info_ = errorInfo;
45
- this ->error_locate_ = locateInfo;
46
42
}
47
43
48
44
CSTATUS (const CSTATUS &status) {
@@ -52,7 +48,6 @@ class CSTATUS {
52
48
53
49
this ->error_code_ = status.error_code_ ;
54
50
this ->error_info_ = status.error_info_ ;
55
- this ->error_locate_ = status.error_locate_ ;
56
51
}
57
52
58
53
CSTATUS (const CSTATUS &&status) noexcept {
@@ -62,15 +57,13 @@ class CSTATUS {
62
57
63
58
this ->error_code_ = status.error_code_ ;
64
59
this ->error_info_ = status.error_info_ ;
65
- this ->error_locate_ = status.error_locate_ ;
66
60
}
67
61
68
62
CSTATUS& operator =(const CSTATUS& status) {
69
63
if (this ->error_code_ != status.error_code_ ) {
70
64
// 如果status是正常的话,则所有数据保持不变
71
65
this ->error_code_ = status.error_code_ ;
72
66
this ->error_info_ = status.error_info_ ;
73
- this ->error_locate_ = status.error_locate_ ;
74
67
}
75
68
return (*this );
76
69
}
@@ -83,7 +76,6 @@ class CSTATUS {
83
76
if (!this ->isErr () && cur.isErr ()) {
84
77
this ->error_code_ = cur.error_code_ ;
85
78
this ->error_info_ = cur.error_info_ ;
86
- this ->error_locate_ = cur.error_locate_ ;
87
79
}
88
80
89
81
return (*this );
@@ -96,7 +88,6 @@ class CSTATUS {
96
88
if (this ->error_code_ != STATUS_OK) {
97
89
this ->error_code_ = STATUS_OK;
98
90
this ->error_info_ .clear ();
99
- this ->error_locate_ .clear ();
100
91
}
101
92
}
102
93
@@ -116,14 +107,6 @@ class CSTATUS {
116
107
return this ->error_info_ ;
117
108
}
118
109
119
- /* *
120
- * 获取报错位置
121
- * @return
122
- */
123
- const std::string& getLocate () const {
124
- return this ->error_locate_ ;
125
- }
126
-
127
110
/* *
128
111
* 判断当前状态是否可行
129
112
* @return
@@ -174,7 +157,6 @@ class CSTATUS {
174
157
private:
175
158
int error_code_ = STATUS_OK; // 错误码信息
176
159
std::string error_info_; // 错误信息描述
177
- std::string error_locate_; // 错误发生的具体位置,形如:file|function|line
178
160
};
179
161
180
162
CGRAPH_INTERNAL_NAMESPACE_END
0 commit comments