diff --git a/studio/host/app/src/options.cpp b/studio/host/app/src/options.cpp index fad57f9..b59ff4d 100644 --- a/studio/host/app/src/options.cpp +++ b/studio/host/app/src/options.cpp @@ -66,7 +66,7 @@ ParsedOptions parse_options(std::span args) for (std::size_t i = 0; i < args.size(); ++i) { const std::string_view arg = args[i]; const bool has_value = i + 1 < args.size(); - const auto fail = [](std::string message) { return ParsedOptions{std::nullopt, std::move(message)}; }; + const auto fail = [](std::string message) { return ParsedOptions{.options=std::nullopt, .error=std::move(message)}; }; if (arg == "--help" || arg == "-h") { options.help = true; } else if (arg == "--detach-core") { @@ -101,9 +101,9 @@ ParsedOptions parse_options(std::span args) } } if (options.core_port == options.ui_port) { - return {std::nullopt, "Le Core et l'interface ne peuvent pas partager le même port."}; + return {.options=std::nullopt, .error="Le Core et l'interface ne peuvent pas partager le même port."}; } - return {options, {}}; + return {.options=options, .error={}}; } std::optional find_core_exe(const std::filesystem::path& exe_dir) @@ -124,7 +124,8 @@ std::optional find_ui_dir(const std::filesystem::path& ex { for (std::filesystem::path dir = exe_dir; dir.has_parent_path() && dir != dir.parent_path(); dir = dir.parent_path()) { - const auto candidate = dir / "studio" / "ui" / "dist"; + // const auto candidate = dir / "studio" / "ui" / "dist"; + auto candidate = dir / "studio" / "ui" / "dist"; if (is_file(candidate / "index.html")) { return candidate; } diff --git a/studio/host/app/src/studio_host.cpp b/studio/host/app/src/studio_host.cpp index 5fa63e2..001f687 100644 --- a/studio/host/app/src/studio_host.cpp +++ b/studio/host/app/src/studio_host.cpp @@ -55,7 +55,9 @@ std::string StudioHost::core_url() const RequestResult StudioHost::request(const std::string& type, const json& payload, std::chrono::milliseconds timeout) { if (!client_) { - return {std::nullopt, Error{ErrorCode::NotConnected, "Pas de connexion au Core.", {}, 0}}; + return {.value=std::nullopt, + .error = Error{.code=ErrorCode::NotConnected,.message= "Pas de connexion au Core.", .server_code={}, .close_code= 0} + }; } return client_->request(type, payload, timeout); } diff --git a/studio/host/client/include/sequa/studio/host/client.hpp b/studio/host/client/include/sequa/studio/host/client.hpp index 9faac22..268f128 100644 --- a/studio/host/client/include/sequa/studio/host/client.hpp +++ b/studio/host/client/include/sequa/studio/host/client.hpp @@ -32,7 +32,7 @@ struct Welcome { }; // Catégorie d'erreur renvoyée par le client. -enum class ErrorCode { +enum class ErrorCode : std::uint8_t { NotConnected, // aucune connexion ouverte au moment de la requête Timeout, // délai dépassé (connexion ou réponse) ConnectFailed, // connexion réseau impossible (hôte/port injoignable)