Show error from cpp-httplib on null response to web service

httplib.h has a helper function to convert Error enumeration to a string

This might help if SSL issues crop up again, or for indicating other
connection errors to user.
This commit is contained in:
Kyle Kienapfel
2022-09-21 15:52:55 -07:00
parent 61399de5db
commit 7e4327c1b6

View File

@@ -111,7 +111,8 @@ struct Client::Impl {
httplib::Error error;
if (!cli->send(request, response, error)) {
LOG_ERROR(WebService, "{} to {} returned null", method, host + path);
LOG_ERROR(WebService, "{} to {} returned null (httplib Error: {})", method, host + path,
httplib::to_string(error));
return WebResult{WebResult::Code::LibError, "Null response", ""};
}