Catch and show exceptions in AI Agent Explorer
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3529587. -->
Reported by: [marcus_johansson](https://www.drupal.org/user/385947)
Related to !146
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Currently the AI Agent Explorer has a network error when you run into an exception when you are developing an agent.</p>
<p>The problem is that you have to open network tools to see the error. It would help a lot if the exception is shown instead on the page when this happens.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p>Create a tool or change a tool to throw and exception.<br>
Create an agent with that tool and a prompt to always runt this tool.<br>
Run the agent in AI Agent Explorer.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add a try catch to the whole runner.<br>
Return the message and the stacktrace as ajax output.</p>
issue