11 #if defined(__MINGW64__) || defined(_WIN32)
26 void set_errors_map_core(std::unordered_map<int, const char *>& tmp_map) {
57 void set_errors_map_core_comm(std::unordered_map<int, const char *>& tmp_map) {
79 void set_errors_map_core_config(std::unordered_map<int, const char *>& tmp_map) {
90 void set_errors_map_services(std::unordered_map<int, const char *>& tmp_map) {
112 SWC_SHOULD_NOT_INLINE
113 void set_errors_map_db(std::unordered_map<int, const char *>& tmp_map) {
150 SWC_SHOULD_NOT_INLINE
151 std::unordered_map<int, const char *> get_errors_map() {
152 std::unordered_map<int, const char *> tmp_map;
154 set_errors_map_core(tmp_map);
155 set_errors_map_core_config(tmp_map);
156 set_errors_map_core_comm(tmp_map);
157 set_errors_map_services(tmp_map);
158 set_errors_map_db(tmp_map);
164 const std::unordered_map<int, const char *> text_map = get_errors_map();
166 static const char ERROR_NOT_REGISTERED[] =
"ERROR NOT REGISTERED";
172 SWC_SHOULD_NOT_INLINE
174 const char* text =
nullptr;
176 text = strerror(err);
178 text = std::future_error(
183 auto it = text_map.find(err);
184 if(it != text_map.cend())
187 return text ? text : ERROR_NOT_REGISTERED;
190 SWC_SHOULD_NOT_INLINE
192 out <<
"error=" << err <<
'(' <<
get_text(err) <<
')';