mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-06-19 06:50:54 +00:00
add try/catch to PostHTTP
This commit is contained in:
@@ -71,7 +71,7 @@ std::string HttpRequest(const std::string& host, int port, const std::string& ta
|
||||
}
|
||||
|
||||
std::string PostHTTP(const std::string& host, const std::string& target, const std::unordered_map<std::string, std::string>& fields, const std::string& body, bool json) {
|
||||
//try {
|
||||
try {
|
||||
net::io_context io;
|
||||
|
||||
// The SSL context is required, and holds certificates
|
||||
@@ -154,8 +154,8 @@ std::string PostHTTP(const std::string& host, const std::string& target, const s
|
||||
debug("POST " + host + target + ": " + debug_response_str);
|
||||
return std::string(response.body());
|
||||
|
||||
/*} catch (const std::exception& e) {
|
||||
} catch (const std::exception& e) {
|
||||
error(e.what());
|
||||
return "-1";
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user