This documentation is for the TIP (development tree) of NNG and may represent unreleased changes or functionality that is experimental, and is subject to change before release. The latest released version is v1.8.0. See the documentation for v1.8.0 for the most up-to-date information.

nng_http_server_res_error(3http)

NAME

nng_http_server_res_error - use HTTP server error page

SYNOPSIS

#include <nng/nng.h>
#include <nng/supplemental/http/http.h>

int nng_http_server_res_error(nng_http_server *server,
        nng_http_res *response);

DESCRIPTION

The nng_http_server_res_error() sets the body of response to server's error page, which may have been customized using the nng_http_server_error_file() or nng_http_server_error_page() functions.

The status code of the response should have already been set, either implicitly by allocating it with nng_http_res_alloc_error(), or by calling nng_http_res_set_status().

Any content body previously set for response will be overridden by this function.

RETURN VALUES

This function returns 0 on success, and non-zero otherwise.

ERRORS

NNG_ENOMEM

Insufficient free memory exists.

NNG_ENOTSUP

HTTP not supported.

SEE ALSO