diff options
author | Max Kellermann <max@musicpd.org> | 2016-09-16 17:15:17 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-09-16 17:43:32 +0200 |
commit | 7acd91331cc6b284032b48d568aa7b53c4a511ce (patch) | |
tree | 2015c6437a12fb8beef86e26f4ac69959b5e0649 /src/input | |
parent | 0fdaca17a2a84eb915514c1174a49c0647abb6a9 (diff) |
input/curl: use C++ exceptions instead of class Error
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/plugins/CurlInputPlugin.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx index 2d1df3a26..2c66231cc 100644 --- a/src/input/plugins/CurlInputPlugin.cxx +++ b/src/input/plugins/CurlInputPlugin.cxx @@ -255,7 +255,6 @@ static bool verify_peer, verify_host; static CurlMulti *curl_multi; -static constexpr Domain http_domain("http"); static constexpr Domain curl_domain("curl"); static constexpr Domain curlm_domain("curlm"); @@ -430,7 +429,7 @@ inline void CurlInputStream::RequestDone(CURLcode result, long status) { assert(io_thread_inside()); - assert(!postponed_error.IsDefined()); + assert(!postponed_exception); FreeEasy(); AsyncInputStream::SetClosed(); @@ -438,12 +437,11 @@ CurlInputStream::RequestDone(CURLcode result, long status) const ScopeLock protect(mutex); if (result != CURLE_OK) { - postponed_error.Format(curl_domain, result, - "curl failed: %s", error_buffer); + postponed_exception = std::make_exception_ptr(FormatRuntimeError("curl failed: %s", + error_buffer)); } else if (status < 200 || status >= 300) { - postponed_error.Format(http_domain, status, - "got HTTP status %ld", - status); + postponed_exception = std::make_exception_ptr(FormatRuntimeError("got HTTP status %ld", + status)); } if (IsSeekPending()) |