diff options
| author | Dan Engelbrecht <[email protected]> | 2025-08-12 13:53:58 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-08-12 13:53:58 +0200 |
| commit | 3a9bc3071b9a9452a5aef23c438233fc9e86fb47 (patch) | |
| tree | b0a1d67fe765f2ddc96772db088d781be159d627 /src/zen/cmds/builds_cmd.cpp | |
| parent | add filtering to builds download (#463) (diff) | |
| download | archived-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.cpp | 9 |
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()); |