raise function

Interrupts request processing

Interrupts request processing

Interrupts request processing and signals RestRserve to return HTTPError

raise(x)

Arguments

  • x: instance of Response . Can be created using HTTPError . see examples.

Returns

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

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")

See Also

HTTPError Application