8#include <userver/clients/http/local_stats.hpp>
10USERVER_NAMESPACE_BEGIN
12namespace clients::
http {
17 BaseException() =
default;
18 BaseException(std::string message,
const LocalStats& stats)
19 : message_(std::move(message)), stats_(stats) {}
20 ~BaseException()
override =
default;
22 const char* what()
const noexcept override {
return message_.c_str(); }
24 const LocalStats& GetStats()
const {
return stats_; }
34 BaseCodeException(std::error_code ec, std::string_view message,
35 std::string_view url,
const LocalStats& stats);
36 ~BaseCodeException()
override =
default;
38 const std::error_code& error_code()
const noexcept {
return ec_; }
47 ~TimeoutException()
override =
default;
53 ~CancelException()
override =
default;
59 ~SSLException()
override =
default;
65 ~TechnicalError()
override =
default;
71 ~BadArgumentException()
override =
default;
77 ~TooManyRedirectsException()
override =
default;
83 ~NetworkProblemException()
override =
default;
89 ~DNSProblemException()
override =
default;
95 ~AuthFailedException()
override =
default;
101 HttpException(
int code,
const LocalStats& stats);
102 HttpException(
int code,
const LocalStats& stats, std::string_view message);
103 ~HttpException()
override =
default;
105 int code()
const {
return code_; }
114 ~HttpClientException()
override =
default;
120 ~HttpServerException()
override =
default;
124std::exception_ptr
PrepareException(std::error_code ec, std::string_view url,
125 const LocalStats& stats);