PluginProbe
404 Solution / 4.2.0
404 Solution v4.2.0
4.3.5 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.2.0 4.1.19 4.1.18 4.1.17 4.1.16 4.1.15 4.1.13 4.1.12 4.1.11 4.1.10 4.1.9 4.1.8 4.1.7 4.1.6 4.1.5 4.1.4 4.1.3 trunk 2.30.0 All 109 releases
404-solution / includes / ViewBuildPendingException.php

ViewBuildPendingException.php in 404 Solution 4.2.0, at includes/ViewBuildPendingException.php

43 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH')) {
4 exit;
5 }
6
7 /**
8 * Thrown by runRedirectsForViewStaged() / runRedirectsForViewCountStaged()
9 * when the precomputed view_done table is missing or invalidated.
10 *
11 * Distinct from ABJ_404_Solution_ViewQueryFailureException: a query *failure*
12 * is a real error worth surfacing diagnostics for. A *pending* build is the
13 * normal cold-start state. view_done has not yet been built, the AJAX gate
14 * is supposed to translate this into a `viewBuildPending` response, and
15 * background cron / the JS poller will advance the build.
16 *
17 * This class lets callers (getRedirectsForView, getRedirectsForViewCount,
18 * the warmup pipeline, and tests) match on "build-not-ready" specifically
19 * without conflating it with infrastructure errors. Carries the current
20 * progress text so admin notices can render the same state the AJAX
21 * progress response shows.
22 */
23 class ABJ_404_Solution_ViewBuildPendingException extends Exception {
24
25 /** @var string */
26 private $progressText;
27
28 /**
29 * @param string $message
30 * @param string $progressText
31 * @param Throwable|null $previous
32 */
33 public function __construct(string $message, string $progressText = '', ?Throwable $previous = null) {
34 parent::__construct($message, 0, $previous);
35 $this->progressText = $progressText;
36 }
37
38 /** @return string */
39 public function getProgressText(): string {
40 return $this->progressText;
41 }
42 }
43