diff options
Diffstat (limited to 'src/other_tools/utils/curl_url_handle.cpp')
-rw-r--r-- | src/other_tools/utils/curl_url_handle.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/other_tools/utils/curl_url_handle.cpp b/src/other_tools/utils/curl_url_handle.cpp index 95f04da1..90102e0b 100644 --- a/src/other_tools/utils/curl_url_handle.cpp +++ b/src/other_tools/utils/curl_url_handle.cpp @@ -189,7 +189,8 @@ auto CurlURLHandle::CreatePermissive(std::string const& url, bool use_non_support_scheme, bool use_no_authority, bool use_path_as_is, - bool use_allow_space) noexcept + bool use_allow_space, + bool ignore_fatal) noexcept -> std::optional<CurlURLHandlePtr> { try { auto url_h = std::make_shared<CurlURLHandle>(); @@ -231,7 +232,7 @@ auto CurlURLHandle::CreatePermissive(std::string const& url, url_h->handle_.reset(handle); return std::make_optional<CurlURLHandlePtr>(url_h); } catch (std::exception const& ex) { - Logger::Log(LogLevel::Error, + Logger::Log(ignore_fatal ? LogLevel::Debug : LogLevel::Error, "CurlURLHandle: creating permissive curl URL handle failed " "unexpectedly with:\n{}", ex.what()); @@ -255,7 +256,8 @@ auto CurlURLHandle::Duplicate() noexcept -> CurlURLHandlePtr { auto CurlURLHandle::GetURL(bool use_default_port, bool use_default_scheme, - bool use_no_default_port) noexcept + bool use_no_default_port, + bool ignore_fatal) noexcept -> std::optional<std::string> { try { // set up flags @@ -274,7 +276,7 @@ auto CurlURLHandle::GetURL(bool use_default_port, char* url = nullptr; auto rc = curl_url_get(handle_.get(), CURLUPART_URL, &url, flags); if (rc != CURLUE_OK) { - Logger::Log(LogLevel::Error, + Logger::Log(ignore_fatal ? LogLevel::Debug : LogLevel::Error, "CurlURLHandle: retrieving URL failed with:\n{}", curl_url_strerror(rc)); return std::nullopt; @@ -285,7 +287,7 @@ auto CurlURLHandle::GetURL(bool use_default_port, return url_str; } catch (std::exception const& ex) { Logger::Log( - LogLevel::Error, + ignore_fatal ? LogLevel::Debug : LogLevel::Error, "CurlURLHandle: retrieving URL failed unexpectedly with:\n{}", ex.what()); return std::nullopt; |