Struct http_error

Inheritance Relationships

Base Type

  • public exception

Struct Documentation

struct udho::exceptions::http_error : public exception

throw HTTP error exception in order to send a HTTP response other than 200 OK. Uncaught exceptions are presented as html page with routing sumary

http_error(boost::beast::http::status::notfound)

Public Types

typedef boost::beast::http::header<false> headers_type

Public Functions

http_error(boost::beast::http::status status, const std::string &message = "")
void add_header(boost::beast::http::field key, const std::string &value)
void redirect(const std::string &url)
template<typename T>
boost::beast::http::response<boost::beast::http::string_body> response(const boost::beast::http::request<T> &request) const
template<typename AuxT, typename U, typename V>
boost::beast::http::response<boost::beast::http::string_body> response(const udho::context<AuxT, U, V> &ctx) const
template<typename T, typename RouterT>
boost::beast::http::response<boost::beast::http::string_body> response(const boost::beast::http::request<T> &request, RouterT &router) const
template<typename AuxT, typename U, typename V, typename RouterT>
boost::beast::http::response<boost::beast::http::string_body> response(const udho::context<AuxT, U, V> &ctx, RouterT &router) const
std::string page(const std::string &target, std::string content = "") const
template<typename RouterT>
std::string page(const std::string &target, RouterT &router) const
const char *what() const noexcept
boost::beast::http::status result() const

Public Members

boost::beast::http::status _status
std::string _message
headers_type _headers