Yoast\WP\SEO\Exceptions\Indexable

Indexing_Failed_Exception::__construct │ public │ Yoast 1.0

Constructs the exception.

Метод класса: Indexing_Failed_Exception{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Indexing_Failed_Exception = new Indexing_Failed_Exception();
$Indexing_Failed_Exception->__construct( $object_id, $object_type, $object_sub_type, $previous );
$object_id(int|null) (обязательный)
The object ID of the indexable that failed to build, or null for id-less object types.
$object_type(строка) (обязательный)
The object type of the indexable that failed to build.
$object_sub_type(строка|null) (обязательный)
The object sub type of the indexable that failed to build.
$previous(Throwable) (обязательный)
The error that caused the failure.

Код Indexing_Failed_Exception::__construct() Yoast 28.9

public function __construct( $object_id, $object_type, $object_sub_type, Throwable $previous ) {
	$this->object_id       = $object_id;
	$this->object_type     = $object_type;
	$this->object_sub_type = $object_sub_type;

	parent::__construct(
		\sprintf(
			/* translators: 1: description of the failing object (e.g. "post #123"); 2: underlying error message. */
			\__( 'Yoast SEO could not build the indexable for %1$s: %2$s', 'wordpress-seo' ),
			$this->get_object_description(),
			$previous->getMessage(),
		),
		0,
		$previous,
	);
}