fix: widen all catch blocks from \Exception to \Throwable

PHP 8.3 TypeError and Error extend \Throwable but NOT \Exception,
so catch(\Exception) silently drops them — explaining why the
generation pipeline fails at the publishing step with no activity
log entry. Now every catch in the generation path catches
\Throwable and logs the exception class name for diagnostics.

Bump to v0.2.7.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-18 10:12:06 +07:00
parent 14e4270158
commit 1968864073
8 changed files with 39 additions and 24 deletions

View File

@@ -173,10 +173,10 @@ PROMPT;
if ( '' !== $scene ) {
return $scene;
}
} catch ( \Exception $e ) {
} catch ( \Throwable $e ) {
// LLM failure is not fatal — fall back to rule-based synthesis.
PRAutoBlogger_Logger::instance()->warning(
'Image prompt LLM rewrite failed, using fallback: ' . $e->getMessage(),
sprintf( 'Image prompt LLM rewrite %s, using fallback: %s', get_class( $e ), $e->getMessage() ),
'image_prompt_builder'
);
}