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)),
21 error_kind_(error_kind)
23 ~BaseException()
override =
default;
25 const char* what()
const noexcept override {
return message_.c_str(); }
27 ErrorKind GetErrorKind()
const {
return error_kind_; }
29 const LocalStats& GetStats()
const {
return stats_; }
40 BaseCodeException(std::error_code ec, std::string_view message, std::string_view url,
const LocalStats& stats);
41 ~BaseCodeException()
override =
default;
43 const std::error_code& error_code()
const noexcept {
return ec_; }
51 TimeoutException(std::string_view message,
const LocalStats& stats);
52 ~TimeoutException()
override =
default;
58 ~CancelException()
override =
default;
64 ~SSLException()
override =
default;
70 ~TechnicalError()
override =
default;
76 ~BadArgumentException()
override =
default;
82 ~TooManyRedirectsException()
override =
default;
88 ~NetworkProblemException()
override =
default;
94 ~DNSProblemException()
override =
default;
100 ~AuthFailedException()
override =
default;
106 HttpException(
int code,
const LocalStats& stats, std::string_view message,
ErrorKind error_kind);
107 ~HttpException()
override =
default;
109 int code()
const {
return code_; }
117 HttpClientException(
int code,
const LocalStats& stats);
118 HttpClientException(
int code,
const LocalStats& stats, std::string_view message);
119 ~HttpClientException()
override =
default;
124 HttpServerException(
int code,
const LocalStats& stats);
125 HttpServerException(
int code,
const LocalStats& stats, std::string_view message);
126 ~HttpServerException()
override =
default;
130std::exception_ptr
PrepareException(std::error_code ec, std::string_view url,
const LocalStats& stats);