PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/routes/indexing-route.php +15 -0 27.7 → trunk View file →
@@ -15,8 +15,9 @@
15 15 use Yoast\WP\SEO\Actions\Indexing\Indexing_Prepare_Action;
16 16 use Yoast\WP\SEO\Actions\Indexing\Post_Link_Indexing_Action;
17 17 use Yoast\WP\SEO\Actions\Indexing\Term_Link_Indexing_Action;
18 18 use Yoast\WP\SEO\Conditionals\No_Conditionals;
19 +use Yoast\WP\SEO\Exceptions\Indexable\Indexing_Failed_Exception;
19 20 use Yoast\WP\SEO\Helpers\Indexing_Helper;
20 21 use Yoast\WP\SEO\Helpers\Options_Helper;
21 22 use Yoast\WP\SEO\Main;
22 23
@@ -417,8 +418,22 @@
417 418 */
418 419 protected function run_indexation_action( Indexation_Action_Interface $indexation_action, $url ) {
419 420 try {
420 421 return parent::run_indexation_action( $indexation_action, $url );
422 + } catch ( Indexing_Failed_Exception $exception ) {
423 + $this->indexing_helper->indexing_failed();
424 +
425 + $previous = $exception->getPrevious();
426 +
427 + return new WP_Error(
428 + 'wpseo_error_indexing',
429 + $exception->getMessage(),
430 + [
431 + 'stackTrace' => ( $previous !== null ) ? $previous->getTraceAsString() : $exception->getTraceAsString(),
432 + 'object_id' => $exception->get_object_id(),
433 + 'object_type' => $exception->get_object_type(),
434 + ],
435 + );
421 436 } catch ( Exception $exception ) {
422 437 $this->indexing_helper->indexing_failed();
423 438
424 439 return new WP_Error(