add service name

This commit is contained in:
chatlanin 2024-07-10 12:59:17 +03:00
parent 767d859ea7
commit 27f222adce

View File

@ -22,9 +22,10 @@ namespace hack
~exception() = default;
public:
void message(const std::string v) noexcept { m_message = v; };
void description(const std::string v) noexcept { m_description = v; };
void system_error(const std::exception& e) noexcept { m_system_error = e.what(); };
void message(const std::string v) noexcept { m_message = v; }
void description(const std::string v) noexcept { m_description = v; }
void system_error(const std::exception& e) noexcept { m_system_error = e.what(); }
void service(const std::string v) noexcept { m_service = v; }
template<typename Param>
void params(std::string key, Param value) { m_params[key] = value; }
@ -68,7 +69,8 @@ namespace hack
j["system_error"] = m_system_error;
j["location"] = m_location.file_name();
j["params"] = m_params;
j["msg_to_front"] = m_message;
j["message"] = m_message;
j["service"] = m_service;
return j;
}
@ -77,6 +79,7 @@ namespace hack
std::string m_message { "no valid data" };
std::string m_description;
std::string m_system_error;
std::string m_service;
std::experimental::source_location m_location;
JSON m_params;
};