roar
Loading...
Searching...
No Matches
curl_error.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <curl/curl.h>
4
5#include <exception>
6#include <string>
7
8namespace Roar::Curl
9{
10 class CurlError : public std::exception
11 {
12 public:
13 CurlError(std::string message, CURLcode code)
14 : m_message{std::string{"Curl error with code "} + std::to_string(code) + ": " + std::move(message)}
15 , m_code{code}
16 {}
17 char const* what() const noexcept
18 {
19 return m_message.c_str();
20 }
21 CURLcode code() const noexcept
22 {
23 return m_code;
24 }
25
26 private:
27 std::string m_message;
28 CURLcode m_code;
29 };
30}
Definition curl_error.hpp:11
std::string m_message
Definition curl_error.hpp:27
CURLcode m_code
Definition curl_error.hpp:28
CURLcode code() const noexcept
Definition curl_error.hpp:21
char const * what() const noexcept
Definition curl_error.hpp:17
CurlError(std::string message, CURLcode code)
Definition curl_error.hpp:13
Definition curl_error.hpp:9
std::string to_string(AuthorizationScheme scheme)
Definition authorization.cpp:28