raise: Interrupts request processing

Description Usage Arguments Value See Also Examples

View source: R/HTTPError.R

Description

Interrupts request processing and signals RestRserve to return HTTPError

Usage

1
raise(x)

Arguments

x

instance of Response. Can be created using HTTPError. see examples.

Value

None - stops execution of the current expression and executes an error action.

See Also

HTTPError Application

Examples

1
2
3
4
5
# catch exception
res = try(raise(HTTPError$bad_request()), silent = TRUE)
cond = attr(res, "condition")
# response is a valid Response instace
identical(cond$response$body$error, "400 Bad Request")

RestRserve documentation built on Jan. 13, 2021, 7:05 p.m.