PluginProbe
404 Solution / 4.3.0
404 Solution v4.3.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 / view-build / ViewQueryFailureException.php

ViewQueryFailureException.php in 404 Solution 4.3.0, at includes/view-build/ViewQueryFailureException.php

40 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 * Exception thrown by getRedirectsForView() / getRedirectsForViewCount() when the
9 * underlying SQL query fails or times out. Carries a structured diagnostics
10 * payload (table counts, indexes, engine + collation, canonical_url backfill
11 * state, MySQL/MariaDB version, EXPLAIN output, redacted query) so the AJAX
12 * error path in ViewUpdater can surface evidence to plugin admins and write it
13 * to the debug log without a follow-up debug zip from the user.
14 *
15 * The diagnostics array is intentionally schema-loose: every diagnostic
16 * sub-query in captureViewQueryFailureDiagnostics() is wrapped in try/catch so
17 * one failed probe never blocks the others. Consumers should treat any key as
18 * potentially absent or string-typed (an error marker) and render accordingly.
19 */
20 class ABJ_404_Solution_ViewQueryFailureException extends Exception {
21
22 /** @var array<string, mixed> */
23 private $diagnostics;
24
25 /**
26 * @param string $message
27 * @param array<string, mixed> $diagnostics
28 * @param Throwable|null $previous
29 */
30 public function __construct(string $message, array $diagnostics = [], ?Throwable $previous = null) {
31 parent::__construct($message, 0, $previous);
32 $this->diagnostics = $diagnostics;
33 }
34
35 /** @return array<string, mixed> */
36 public function getDiagnostics(): array {
37 return $this->diagnostics;
38 }
39 }
40