Provide an exception interface all exceptions implement
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3542498. -->
Reported by: [mglaman](https://www.drupal.org/user/2416470)
Related to !854
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>It's hard to catch all of the exceptions from this framework. Granted, I could do specifics and then a generic \Exception. But it'd be easier if there was an AiException interface that each exception implemented. Then I could just catch that one generic exception and know it was from the AI framework</p>
<h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>Please provide information like AI modules enabled, which AI provider, browser, etc.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Provide <code>AiExceptionInterface</code>:</p>
<pre>interface AiExceptionInterface extends \Throwable {<br>}</pre><p>Then all exceptions in the module implement this interface along with whatever they're extending</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
issue