diff --git a/src/lib/curl/Easy.hxx b/src/lib/curl/Easy.hxx index 5545499b4..52e9170d8 100644 --- a/src/lib/curl/Easy.hxx +++ b/src/lib/curl/Easy.hxx @@ -63,9 +63,14 @@ public: return handle; } + template + CURLcode TrySetOption(CURLoption option, T value) noexcept { + return curl_easy_setopt(handle, option, value); + } + template void SetOption(CURLoption option, T value) { - CURLcode code = curl_easy_setopt(handle, option, value); + CURLcode code = TrySetOption(option, value); if (code != CURLE_OK) throw Curl::MakeError(code, "Failed to set option"); }