// 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; }
void err(beast::error_code const& ec, String const& what) { std::cerr << what << ": " << ec.message() << std::endl; }