raise: Interrupts request processing

View source: R/HTTPError.R

raiseR Documentation

Interrupts request processing

Description

Interrupts request processing and signals RestRserve to return HTTPError

Usage

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

# 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 May 29, 2024, 8:18 a.m.