diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-06-15 12:50:03 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-06-15 13:39:29 -0700 |
| commit | 5ecea06b1f39a93735e8b2f711b125d0b1a84d16 (patch) | |
| tree | 843c699c3618328856c0b373a4b49b75205bf234 /docs/man/nng_http_server_res_error.3http.adoc | |
| parent | 16088417694de3d3300ae8429c20e944128d3f52 (diff) | |
| download | nng-5ecea06b1f39a93735e8b2f711b125d0b1a84d16.tar.gz nng-5ecea06b1f39a93735e8b2f711b125d0b1a84d16.tar.bz2 nng-5ecea06b1f39a93735e8b2f711b125d0b1a84d16.zip | |
fixes #539 Feature request: customizable http error page
Diffstat (limited to 'docs/man/nng_http_server_res_error.3http.adoc')
| -rw-r--r-- | docs/man/nng_http_server_res_error.3http.adoc | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/docs/man/nng_http_server_res_error.3http.adoc b/docs/man/nng_http_server_res_error.3http.adoc new file mode 100644 index 00000000..a62628f7 --- /dev/null +++ b/docs/man/nng_http_server_res_error.3http.adoc @@ -0,0 +1,63 @@ += nng_http_server_res_error(3http) +// +// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2018 Capitar IT Group BV <info@capitar.com> +// +// This document is supplied under the terms of the MIT License, a +// copy of which should be located in the distribution where this +// file was obtained (LICENSE.txt). A copy of the license may also be +// found online at https://opensource.org/licenses/MIT. +// + +== NAME + +nng_http_server_res_error - use HTTP server error page + +== SYNOPSIS + +[source, c] +---- +#include <nng/nng.h> +#include <nng/supplemental/http/http.h> + +int nng_http_server_set_error_file(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_set_error_file.3http#,nng_http_server_error_file()>>` +or +`<<nng_http_server_set_error_page.3http#,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.3http#,nng_http_res_alloc_error()>>`, +or by calling +`<<nng_http_res_set_status.3http#,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 + +[horizontal] +`NNG_ENOMEM`:: Insufficient free memory exists. +`NNG_ENOTSUP`:: HTTP not supported. + +== SEE ALSO + +[.text-left] +<<nng_http_res_alloc_error.3http#,nng_http_res_alloc_error(3http)>>, +<<nng_http_server_hold.3http#,nng_http_server_hold(3http)>>, +<<nng_http_server_set_error_file.3http#,nng_http_server_set_error_file(3http)>>, +<<nng_http_server_set_error_page.3http#,nng_http_server_set_error_page(3http)>>, +<<nng_strerror.3#,nng_strerror(3)>>, +<<nng.7#,nng(7)>> |
