delete e.what() in json return after error

This commit is contained in:
Andrey Kutin 2026-08-06 09:20:20 +03:00
parent 7387cc4611
commit cbb58efcdd
2 changed files with 1 additions and 6 deletions

View File

@ -85,7 +85,6 @@ json Database::getRandomRecord() {
} catch (const std::exception& e) { } catch (const std::exception& e) {
return json{ return json{
{"error", "Database error in getRandomRecord"}, {"error", "Database error in getRandomRecord"},
{"message", e.what()}
}; };
} }
} }
@ -180,7 +179,6 @@ json Database::getRandomRecordsFast(const int count) {
txn.abort(); txn.abort();
return json{ return json{
{"error", "Database error in fast recursive CTE strategy"}, {"error", "Database error in fast recursive CTE strategy"},
{"message", e.what()}
}; };
} }
} }
@ -244,7 +242,6 @@ json Database::getRandomRecordsSlow(const int count, const int totalCount) {
txn.abort(); txn.abort();
return json{ return json{
{"error", "Database error in slow strategy"}, {"error", "Database error in slow strategy"},
{"message", e.what()}
}; };
} }
} }
@ -320,4 +317,4 @@ std::string Database::getQueryRandomIds(const int count){
} }
query += ") ORDER BY id"; query += ") ORDER BY id";
return query; return query;
} }

View File

@ -64,7 +64,6 @@ void HttpSession::processRequest(http::request<http::string_body>&& request) {
res.result(http::status::not_found); res.result(http::status::not_found);
json error = { json error = {
{"error", "Not Found"}, {"error", "Not Found"},
//{"path", request.target()}
}; };
res.body() = error.dump(4); res.body() = error.dump(4);
} }
@ -72,7 +71,6 @@ void HttpSession::processRequest(http::request<http::string_body>&& request) {
res.result(http::status::internal_server_error); res.result(http::status::internal_server_error);
json error = { json error = {
{"error", "Internal Server Error"}, {"error", "Internal Server Error"},
//{"message", e.what()}
}; };
res.body() = error.dump(4); res.body() = error.dump(4);
} }