diff --git a/src/curl_wrapper.cpp b/src/curl_wrapper.cpp index d233117..768922d 100644 --- a/src/curl_wrapper.cpp +++ b/src/curl_wrapper.cpp @@ -247,7 +247,7 @@ const char *CURLException::what() const noexcept // NOTE: The string has to be static, or it'll vanish before it can be // used. Couldn't find good documentation on that. static string error_string; - error_string = _error_message; + error_string = error_message; if (!error_string.empty()) { error_string = " – " + error_string; diff --git a/src/curl_wrapper.hpp b/src/curl_wrapper.hpp index 01aa825..ad1939c 100644 --- a/src/curl_wrapper.hpp +++ b/src/curl_wrapper.hpp @@ -243,10 +243,11 @@ public: */ explicit CURLException(const CURLcode code, string_view error_buffer) : error_code{code} - , _error_message{error_buffer} + , error_message{error_buffer} {} - const CURLcode error_code; //!< Error code from libcurl. + const CURLcode error_code; //!< Error code from libcurl. + const string error_message; //!< The error message. /*! * @brief Error message. @@ -254,9 +255,6 @@ public: * @since 0.1.0 */ [[nodiscard]] const char *what() const noexcept override; - -private: - string _error_message; }; } // namespace curl_wrapper