// vdm/net/curl_error.hpp — internal: CURLcode -> vdm::Error. Not a public header. #ifndef VDM_NET_CURL_ERROR_HPP #define VDM_NET_CURL_ERROR_HPP #include #include #include "vdm/util/error.hpp" namespace vdm::net::detail { // Map a libcurl transfer result to the engine taxonomy. `http_status` (0 if none) lets // the HTTP-status errors (403/404/416/...) be classified here too; pass it from // CURLINFO_RESPONSE_CODE. `CURLE_OK` with a >= 400 status still yields an error. [[nodiscard]] Error error_from_curl(CURLcode code, long http_status) noexcept; // A human-readable ErrorInfo, folding in curl's own message and the status. [[nodiscard]] ErrorInfo make_error(CURLcode code, long http_status, const char *curl_msg = nullptr); } // namespace vdm::net::detail #endif // VDM_NET_CURL_ERROR_HPP