RestException
Class. It extends RuntimeException.
Ends a REST request with an error response: thrown from a route or permission method, it becomes a WP_Error with the given code and HTTP status.
Constructor
Methods
getData()
The additional error data as given to the constructor; in the response, status is always the status of the
exception.
Returns array<string, mixed>
getErrorCode()
The machine-readable error code of the response.
Returns string
getStatus()
The HTTP status of the response, 400 to 599.
Returns int