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,
ErrorKind error_kind)
19 : message_(std::move(message)), stats_(stats), error_kind_(error_kind) {}
20 ~BaseException()
override =
default;
22 const char* what()
const noexcept override {
return message_.c_str(); }
24 ErrorKind GetErrorKind()
const {
return error_kind_; }
26 const LocalStats& GetStats()
const {
return stats_; }
37 BaseCodeException(std::error_code ec, std::string_view message, std::string_view url,
const LocalStats& stats);
38 ~BaseCodeException()
override =
default;
40 const std::error_code& error_code()
const noexcept {
return ec_; }
48 TimeoutException(std::string_view message,
const LocalStats& stats);
49 ~TimeoutException()
override =
default;
55 ~CancelException()
override =
default;
61 ~SSLException()
override =
default;
67 ~TechnicalError()
override =
default;
73 ~BadArgumentException()
override =
default;
79 ~TooManyRedirectsException()
override =
default;
85 ~NetworkProblemException()
override =
default;
91 ~DNSProblemException()
override =
default;
97 ~AuthFailedException()
override =
default;
103 HttpException(
int code,
const LocalStats& stats, std::string_view message,
ErrorKind error_kind);
104 ~HttpException()
override =
default;
106 int code()
const {
return code_; }
114 HttpClientException(
int code,
const LocalStats& stats);
115 HttpClientException(
int code,
const LocalStats& stats, std::string_view message);
116 ~HttpClientException()
override =
default;
121 HttpServerException(
int code,
const LocalStats& stats);
122 HttpServerException(
int code,
const LocalStats& stats, std::string_view message);
123 ~HttpServerException()
override =
default;
127std::exception_ptr
PrepareException(std::error_code ec, std::string_view url,
const LocalStats& stats);