/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
cloud/filestore/apps/client/lib/stop_endpoint.cpp
53 строки
1 KB
Andrei Strelkovskii
fixing 'ythrow TServiceError' pattern which breaks exception messages - introduced STORAGE_THROW_SERVICE_ERROR macro which builds much better messages (#4888)
21 дек 2025, 16:41
Не верифицирован
21 дек 2025, 16:41
8caf308
Код
Авторство
О чём код?
#include "command.h" namespace NCloud::NFileStore::NClient { namespace { //////////////////////////////////////////////////////////////////////////////// class TStopEndpointCommand final : public TEndpointCommand { private: TString SocketPath; public: TStopEndpointCommand() { Opts.AddLongOption("socket-path") .Required() .RequiredArgument("STR") .StoreResult(&SocketPath); } bool Execute() override { auto callContext = PrepareCallContext(); auto request = std::make_shared<NProto::TStopEndpointRequest>(); request->SetSocketPath(SocketPath); auto response = WaitFor( Client->StopEndpoint( std::move(callContext), std::move(request))); if (HasError(response)) { STORAGE_THROW_SERVICE_ERROR(response.GetError()); } return true; } }; } // namespace //////////////////////////////////////////////////////////////////////////////// TCommandPtr NewStopEndpointCommand() { return std::make_shared<TStopEndpointCommand>(); } } // namespace NCloud::NFileStore::NClient