diff options
Diffstat (limited to 'src/zen/cmds/cache_cmd.cpp')
| -rw-r--r-- | src/zen/cmds/cache_cmd.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/zen/cmds/cache_cmd.cpp b/src/zen/cmds/cache_cmd.cpp index 4412eaf34..90f428b29 100644 --- a/src/zen/cmds/cache_cmd.cpp +++ b/src/zen/cmds/cache_cmd.cpp @@ -115,11 +115,11 @@ DropCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) if (Result.status_code) { - ZEN_ERROR("Drop failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); + ZEN_CONSOLE_ERROR("Drop failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); } else { - ZEN_ERROR("Drop failed: {}", Result.error.message); + ZEN_CONSOLE_ERROR("Drop failed: {}", Result.error.message); } return 1; @@ -217,11 +217,11 @@ CacheInfoCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) if (Result.status_code) { - ZEN_ERROR("Info failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); + ZEN_CONSOLE_ERROR("Info failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); } else { - ZEN_ERROR("Info failed: {}", Result.error.message); + ZEN_CONSOLE_ERROR("Info failed: {}", Result.error.message); } return 1; @@ -267,11 +267,11 @@ CacheStatsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv if (Result.status_code) { - ZEN_ERROR("Info failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); + ZEN_CONSOLE_ERROR("Info failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); } else { - ZEN_ERROR("Info failed: {}", Result.error.message); + ZEN_CONSOLE_ERROR("Info failed: {}", Result.error.message); } return 1; @@ -336,9 +336,7 @@ CacheDetailsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** ar { if (m_Namespace.empty() || m_Bucket.empty()) { - ZEN_ERROR("Provide namespace and bucket name"); - ZEN_CONSOLE("{}", m_Options.help({""}).c_str()); - return 1; + throw OptionParseException("Provide namespace and bucket name"); } Session.SetUrl({fmt::format("{}/z$/details$/{}/{}/{}", m_HostName, m_Namespace, m_Bucket, m_ValueKey)}); } @@ -346,9 +344,7 @@ CacheDetailsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** ar { if (m_Namespace.empty()) { - ZEN_ERROR("Provide namespace name"); - ZEN_CONSOLE("{}", m_Options.help({""}).c_str()); - return 1; + throw OptionParseException("Provide namespace name"); } Session.SetUrl({fmt::format("{}/z$/details$/{}/{}", m_HostName, m_Namespace, m_Bucket)}); } @@ -373,11 +369,11 @@ CacheDetailsCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** ar if (Result.status_code) { - ZEN_ERROR("Info failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); + ZEN_CONSOLE_ERROR("Info failed: {}: {} ({})", Result.status_code, Result.reason, Result.text); } else { - ZEN_ERROR("Info failed: {}", Result.error.message); + ZEN_CONSOLE_ERROR("Info failed: {}", Result.error.message); } return 1; |