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) {
|
} 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()}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue