fix(launch): Fix several launch failure conditions (exceptions thrown in child.wait, and boost::split_unix) (#4390)
This commit is contained in:
parent
1d6d916b7a
commit
852dee0a68
2 changed files with 26 additions and 5 deletions
|
|
@ -40,6 +40,8 @@ using namespace std::literals;
|
|||
|
||||
namespace nvhttp {
|
||||
|
||||
static constexpr std::string_view EMPTY_PROPERTY_TREE_ERROR_MSG = "Property tree is empty. Probably, control flow got interrupted by an unexpected C++ exception. This is a bug in Sunshine. Moonlight-qt will report Malformed XML (missing root element)."sv;
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
namespace pt = boost::property_tree;
|
||||
|
||||
|
|
@ -816,6 +818,10 @@ namespace nvhttp {
|
|||
auto g = util::fail_guard([&]() {
|
||||
std::ostringstream data;
|
||||
|
||||
if (tree.empty()) {
|
||||
BOOST_LOG(error) << EMPTY_PROPERTY_TREE_ERROR_MSG;
|
||||
}
|
||||
|
||||
pt::write_xml(data, tree);
|
||||
response->write(data.str());
|
||||
response->close_connection_after_response = true;
|
||||
|
|
@ -922,6 +928,10 @@ namespace nvhttp {
|
|||
auto g = util::fail_guard([&]() {
|
||||
std::ostringstream data;
|
||||
|
||||
if (tree.empty()) {
|
||||
BOOST_LOG(error) << EMPTY_PROPERTY_TREE_ERROR_MSG;
|
||||
}
|
||||
|
||||
pt::write_xml(data, tree);
|
||||
response->write(data.str());
|
||||
response->close_connection_after_response = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue