Make error message of CURLException public.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
tastytea 2021-02-09 17:07:10 +01:00
parent fe5707b610
commit 3a71a14f56
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 4 additions and 6 deletions

View File

@ -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 // NOTE: The string has to be static, or it'll vanish before it can be
// used. Couldn't find good documentation on that. // used. Couldn't find good documentation on that.
static string error_string; static string error_string;
error_string = _error_message; error_string = error_message;
if (!error_string.empty()) if (!error_string.empty())
{ {
error_string = " " + error_string; error_string = " " + error_string;

View File

@ -243,10 +243,11 @@ public:
*/ */
explicit CURLException(const CURLcode code, string_view error_buffer) explicit CURLException(const CURLcode code, string_view error_buffer)
: error_code{code} : 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. * @brief Error message.
@ -254,9 +255,6 @@ public:
* @since 0.1.0 * @since 0.1.0
*/ */
[[nodiscard]] const char *what() const noexcept override; [[nodiscard]] const char *what() const noexcept override;
private:
string _error_message;
}; };
} // namespace curl_wrapper } // namespace curl_wrapper