fix errors

This commit is contained in:
chatlanin 2024-07-08 11:41:54 +03:00
parent 99c0b73039
commit 7b5ba9122b

View File

@ -51,6 +51,15 @@ namespace hack
error()(r);
}
template<typename HttpResponse>
void commit(const HttpResponse& res)
{
JSON j;
j["status"] = "error";
j["result"] = m_message;
res.set_content(nlohmann::to_string(j), "application/json");
}
void commit(const std::filesystem::path file_name = DEF_FILE_NAME(), std::string line = DEF_LINE())
{
error("")(file_name,":", line, ": ", m_message);