Processing automators does not catch all errors
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3573429. -->
Reported by: [fago](https://www.drupal.org/user/16747)
Related to !1200 !1199
>>>
<p>[Tracker]<br>
<strong>Update Summary: </strong>[One-line status update for stakeholders]<br>
<strong>Short Description: </strong>[One-line issue summary for stakeholders]<br>
<strong>Check-in Date: </strong>MM/DD/YYYY<br>
<em>Metadata is used by the <a href="https://www.drupalstarforge.ai/" title="AI Tracker">AI Tracker.</a> Docs and additional fields <a href="https://www.drupalstarforge.ai/ai-dashboard/docs" title="AI Issue Tracker Documentation">here</a>.</em><br>
[/Tracker]</p>
<h3 id="summary-problem-motivation">Problem</h3>
<p>When processing automators with the OpenAI provider, it may happen that bad responses result in PHP errors thrown. While this should not happen and ideally the provider/library should be able to handle that better, we don't want an error like this be left unhandled.</p>
<p>Note: I ran into this <a href="https://www.drupal.org/project/ai/issues/3566583#comment-16469464">here</a>, where you can find an example stracktrace.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>When processing automators, catch all \Throwable errors, not only \Exception. This will allow it to catch general PHP errors as well.</p>
<h3 id="summary-ai-usage">AI usage (if applicable)</h3>
<p>[x ] AI Generated Code<br>
This code was mainly generated by an AI with human guidance, and reviewed, tested, and refined by a human.</p>
issue