From f82ee35bff7363e6381d659b26773f260109e2ea Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Thu, 27 Jun 2024 17:42:01 +0200 Subject: Use (un)expected for serve service --- src/buildtool/serve_api/serve_service/target.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/buildtool/serve_api/serve_service/target.hpp') diff --git a/src/buildtool/serve_api/serve_service/target.hpp b/src/buildtool/serve_api/serve_service/target.hpp index 7b1d0ec9..5301b82c 100644 --- a/src/buildtool/serve_api/serve_service/target.hpp +++ b/src/buildtool/serve_api/serve_service/target.hpp @@ -21,7 +21,6 @@ #include #include #include -#include #include #include "gsl/gsl" @@ -35,6 +34,7 @@ #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/serve_api/remote/config.hpp" #include "src/buildtool/serve_api/remote/serve_api.hpp" +#include "src/utils/cpp/expected.hpp" // The target-level cache service. class TargetService final : public justbuild::just_serve::Target::Service { @@ -132,11 +132,11 @@ class TargetService final : public justbuild::just_serve::Target::Service { /// \brief Get from remote and parse the endpoint configuration. The method /// also ensures the content has the expected format. - /// \returns An error + data union, with a pair of grpc status at index 0 - /// and the dispatch list stored as a JSON object at index 1. + /// \returns The dispatch list stored as JSON object on success or an + /// unexpected error as grpc::Status. [[nodiscard]] auto GetDispatchList( ArtifactDigest const& dispatch_digest) noexcept - -> std::variant<::grpc::Status, dispatch_t>; + -> expected; /// \brief Handles the processing of the log after a failed analysis or /// build. Will populate the response as needed and set the status to be -- cgit v1.2.3