aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/builds_cmd.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-12 13:53:58 +0200
committerGitHub Enterprise <[email protected]>2025-08-12 13:53:58 +0200
commit3a9bc3071b9a9452a5aef23c438233fc9e86fb47 (patch)
treeb0a1d67fe765f2ddc96772db088d781be159d627 /src/zen/cmds/builds_cmd.cpp
parentadd filtering to builds download (#463) (diff)
downloadarchived-zen-3a9bc3071b9a9452a5aef23c438233fc9e86fb47.tar.xz
archived-zen-3a9bc3071b9a9452a5aef23c438233fc9e86fb47.zip
use new builds api for oplogs (#464)
- Improvement: Refactored jupiter oplog export code to reuse builds jupiter wrapper classes - Improvement: If `zen builds`, `zen oplog-import` or `zen oplog-import` command fails due to a http error, the return code for the program will be set to the error/status code
Diffstat (limited to 'src/zen/cmds/builds_cmd.cpp')
-rw-r--r--src/zen/cmds/builds_cmd.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp
index aa6ae5ea4..cf5e8d9da 100644
--- a/src/zen/cmds/builds_cmd.cpp
+++ b/src/zen/cmds/builds_cmd.cpp
@@ -10785,9 +10785,7 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
DiscoveryHttpClient.Get("/api/v1/status/servers", HttpClient::Accept(HttpContentType::kJSON));
if (!ServerInfoResponse.IsSuccess())
{
- throw std::runtime_error(fmt::format("Failed to get list of servers from discovery url '{}'. Reason: '{}'",
- m_Host,
- ServerInfoResponse.ErrorMessage("")));
+ ServerInfoResponse.ThrowError(fmt::format("Failed to get list of servers from discovery url '{}'", m_Host));
}
std::string_view JsonResponse = ServerInfoResponse.AsText();
@@ -12166,6 +12164,11 @@ BuildsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
return 3;
}
}
+ catch (const HttpClientError& HttpEx)
+ {
+ ZEN_CONSOLE("Operation failed: {}", HttpEx.what());
+ return HttpEx.m_Error != 0 ? HttpEx.m_Error : (int)HttpEx.m_ResponseCode;
+ }
catch (const std::exception& Ex)
{
ZEN_ERROR("{}", Ex.what());