WordPress at a glance
function is not described

WP_REST_Response::is_error() public WP 4.4.0

Checks if the response is an error, i.e. >= 400 response code.

It's a method of the class: WP_REST_Response{}

No Hooks.

Return

true/false. Whether the response is an error.

Usage

$WP_REST_Response = new WP_REST_Response();
$WP_REST_Response->is_error();

Changelog

Since 4.4.0 Introduced.

Code of WP_REST_Response::is_error() WP 5.5.1

<?php
public function is_error() {
	return $this->get_status() >= 400;
}