HttpError | R Documentation |
Special error classes for HTTP. See also as_http_error_body()
for
turning R errors into lists that can be returned by plumber APIs.
HttpError(message, status, ..., headers = NULL, class = NULL, call = NULL) HttpServerError( message, status, ..., headers = NULL, class = NULL, call = NULL ) HttpInternalServerError( message = "Internal Server Error", ..., headers = NULL, class = NULL, call = NULL ) HttpServiceUnavailableError( message = "Service Unavailable", ..., headers = NULL, class = NULL, call = NULL, retry_after = NULL ) HttpClientError( message, status, ..., headers = NULL, class = NULL, call = NULL ) HttpBadRequestError( message = "Bad Request", ..., headers = NULL, class = NULL, call = NULL ) HttpNotFoundError( message = "Not Found", ..., headers = NULL, class = NULL, call = NULL ) HttpConflictError( message = "Conflict", ..., headers = NULL, class = NULL, call = NULL )
an error condition
object with the subclasses
HttpError
, http_error
and http_<status>
. The latter two are for
compatability with httr::http_condition()
objects. The error conditions
reflect the hirarchy, e.g. HttpServiceUnavailableError
inherits from
HttpServerError
, HttpError
, http_500
, http_error
.
https://tools.ietf.org/html/rfc7231#section-6
print(class(HttpServiceUnavailableError())) tryCatch( stop(HttpServiceUnavailableError()), HttpServiceUnavailableError = function(e) print(e) ) tryCatch( stop(HttpServiceUnavailableError()), http_503 = function(e) print(e) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.