delete e.what() in json return after error
This commit is contained in:
parent
7387cc4611
commit
cbb58efcdd
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue