Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
25 lines
731 B
PHP
25 lines
731 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace LIT\MCP\Integrations\Divi\ThemeBuilder;
|
|
|
|
use RuntimeException;
|
|
use Throwable;
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
/**
|
|
* Divi failed after its own wp_insert_post() already created posts (a throwing hook, a wp_die() turned into an
|
|
* exception by DiviThemeBuilder::guarded()): $postIds are the new posts of the expected types, so the caller can
|
|
* roll them back (ruling Q19). The message is the original failure's.
|
|
*/
|
|
final class InsertedBeforeFailure extends RuntimeException
|
|
{
|
|
/** @param list<int> $postIds */
|
|
public function __construct(string $message, public readonly array $postIds, ?Throwable $previous = null)
|
|
{
|
|
parent::__construct($message, 0, $previous);
|
|
}
|
|
}
|