fix: typed write failures, template rollback, parent and term cleanup
WriteFailed maps to lit_write_failed / lit_partial_write (partial writes are logged with result partial); old template read before the update; row marker set before wp_update_post; created terms deleted on rollback; parent must be a readable non-descendant of a hierarchical type; featured image must be readable; snapshot keeps empty values; meta comparison after sanitize_meta; follow-up failures (listener, change log) only add warnings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -71,6 +71,10 @@ final class AbilityRegistrar
|
||||
'execute_callback' => static function (mixed $input = null) use ($ability): mixed {
|
||||
try {
|
||||
return $ability->execute(is_array($input) ? $input : []);
|
||||
} catch (WriteFailed $e) {
|
||||
$message = sprintf('[wp-lit-mcp] %s failed: %s', $ability->name(), $e);
|
||||
error_log($message); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
|
||||
return $e->toError();
|
||||
} catch (Throwable $e) {
|
||||
$message = sprintf('[wp-lit-mcp] %s failed: %s', $ability->name(), $e);
|
||||
error_log($message); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
|
||||
|
||||
Reference in New Issue
Block a user