diff --git a/client/scenes/lobby.cpp b/client/scenes/lobby.cpp index 023fb97a..9d6572ec 100644 --- a/client/scenes/lobby.cpp +++ b/client/scenes/lobby.cpp @@ -212,6 +212,7 @@ std::unique_ptr connect_to_session(wivrn_discover::service servic freeaddrinfo(addresses); } + std::string error; for (const auto & address: service.addresses) { std::string address_string = std::visit([](auto & address) { @@ -230,11 +231,15 @@ std::unique_ptr connect_to_session(wivrn_discover::service servic } catch (std::exception & e) { - spdlog::warn("Cannot connect to {} ({}): {}", service.hostname, address_string, e.what()); + std::string txt = fmt::format("Cannot connect to {} ({}): {}", service.hostname, address_string, e.what()); + spdlog::warn(txt); + if (not error.empty()) + error += "\n"; + error += txt; } } - throw std::runtime_error("No usable address"); + throw std::runtime_error(error); } static glm::mat4 projection_matrix(XrFovf fov, float zn = 0.02)