Exemplo n.º 1
0
 // Return an HTTP Server Error
 //
 http::response<http::string_body>
 server_error(beast::error_code const& ec) const
 {
     http::response<http::string_body> res{http::status::internal_server_error, 11};
     res.set(http::field::server, BEAST_VERSION_STRING);
     res.set(http::field::content_type, "text/html");
     res.set(http::field::connection, "close");
     res.body = "Error: " + ec.message();
     res.prepare_payload();
     return res;
 }
Exemplo n.º 2
0
void
err(beast::error_code const& ec, String const& what)
{
    std::cerr << what << ": " << ec.message() << std::endl;
}