8#include <userver/clients/http/error_kind.hpp>
9#include <userver/clients/http/local_stats.hpp>
11USERVER_NAMESPACE_BEGIN
13namespace clients::http {
18 BaseException(std::string message,
const LocalStats& stats,
20 : message_(std::move(message)), stats_(stats), error_kind_(error_kind) {}
21 ~BaseException()
override =
default;
23 const char* what()
const noexcept override {
return message_.c_str(); }
25 ErrorKind GetErrorKind()
const {
return error_kind_; }
27 const LocalStats& GetStats()
const {
return stats_; }
38 BaseCodeException(std::error_code ec, std::string_view message,
39 std::string_view url,
const LocalStats& stats);
40 ~BaseCodeException()
override =
default;
42 const std::error_code& error_code()
const noexcept {
return ec_; }
50 TimeoutException(std::string_view message,
const LocalStats& stats);
51 ~TimeoutException()
override =
default;
57 ~CancelException()
override =
default;
63 ~SSLException()
override =
default;
69 ~TechnicalError()
override =
default;
75 ~BadArgumentException()
override =
default;
81 ~TooManyRedirectsException()
override =
default;
87 ~NetworkProblemException()
override =
default;
93 ~DNSProblemException()
override =
default;
99 ~AuthFailedException()
override =
default;
105 HttpException(
int code,
const LocalStats& stats, std::string_view message,
107 ~HttpException()
override =
default;
109 int code()
const {
return code_; }
117 HttpClientException(
int code,
const LocalStats& stats);
118 HttpClientException(
int code,
const LocalStats& stats,
119 std::string_view message);
120 ~HttpClientException()
override =
default;
125 HttpServerException(
int code,
const LocalStats& stats);
126 HttpServerException(
int code,
const LocalStats& stats,
127 std::string_view message);
128 ~HttpServerException()
override =
default;
132std::exception_ptr
PrepareException(std::error_code ec, std::string_view url,
133 const LocalStats& stats);