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) {
return json{
{"error", "Database error in getRandomRecord"},
{"message", e.what()}
};
}
}
@ -180,7 +179,6 @@ json Database::getRandomRecordsFast(const int count) {
txn.abort();
return json{
{"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();
return json{
{"error", "Database error in slow strategy"},
{"message", e.what()}
};
}
}
@ -320,4 +317,4 @@ std::string Database::getQueryRandomIds(const int count){
}
query += ") ORDER BY id";
return query;
}
}

View File

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