WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

ErrorSchema::get_item_response() public WC 1.0

Convert a WP_Error into an object suitable for the response.

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

No Hooks.

Return

Array.

Usage

$ErrorSchema = new ErrorSchema();
$ErrorSchema->get_item_response( $error );
$error(WP_Error) (required)
Error object.

Code of ErrorSchema::get_item_response() WC 5.8.0

public function get_item_response( \WP_Error $error ) {
	return [
		'code'    => $this->prepare_html_response( $error->get_error_code() ),
		'message' => $this->prepare_html_response( $error->get_error_message() ),
	];
}