create_error_page: Customize the error pages on the server

Description Usage Arguments Value Examples

View source: R/create_error_page.R

Description

Defines a new page for any http error status. These pages are always html (mime = text/html) but can use any number of resources (css, png, js, ...) which must be uploaded appropriately using link_web_resource().

Usage

1
create_error_page(http_status, html, host = .host.)

Arguments

http_status

The http status code returned as an error. Only those specified in Jazz API. E.g., 400 (Bad Request) - Syntactical error at top level. (Malformed URI)

html

The html page to be served for that error.

host

(Optional) the name of the jazz server host (including the port). Usually set just once via set_jazz_host().

Value

Returns TRUE on success or throws an error on failure.

Examples

1
2
3
4
5
## Not run: 
page <- '<html>\n<body>\n<br/>Resource was not found on this node.\n</body>\n</html>'
create_error_page(404, page)

## End(Not run)

rjazz documentation built on May 2, 2019, 2:45 p.m.