From 374da51607eb88a9123a1f9d807f17ef68f0efbd Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 16 Dec 2024 21:44:02 -0600 Subject: [PATCH] Move an error inside a conditional --- src/launchpad.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/launchpad.cpp b/src/launchpad.cpp index e13438d..1eaaaa8 100644 --- a/src/launchpad.cpp +++ b/src/launchpad.cpp @@ -221,8 +221,8 @@ std::string launchpad::build_full_url(const std::string& endpoint) const { std::optional launchpad::api_get(const std::string& endpoint, const std::map& params) const { std::string url = build_full_url(endpoint); if (url.empty()) { - std::cerr << "Internal error: please include the following info in a bug report:" << std::endl; if (!params.empty()) { + std::cerr << "Internal error: please include the following info in a bug report:" << std::endl; for (const auto& [key, value] : params) { std::cerr << url_encode(key) + "=" + url_encode(value) + "&"; } @@ -302,8 +302,8 @@ std::optional launchpad::api_post( const std::string& token_secret_override ) { if (endpoint.empty()) { - std::cerr << "Internal error: please include the following info in a bug report:" << std::endl; if (!params.empty()) { + std::cerr << "Internal error: please include the following info in a bug report:" << std::endl; for (const auto& [key, value] : params) { std::cerr << url_encode(key) + "=" + url_encode(value) + "&"; }