Surface verbose OpenAPI errors in the UI — for better bug reports and faster DX
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3470321. -->
Reported by: [traviscarden](https://www.drupal.org/user/236758)
Related to !569
>>>
<h3 id="overview">Overview</h3>
<p>PHP exceptions currently bubble up to error messages like the following in the UI. This will be confusing to end users, and it's not very helpful for local development.</p>
<p><img src="https://www.drupal.org/files/issues/2024-08-26/xb-ui-error.png" alt=""></p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p>I propose doing two things:</p>
<ol>
<li>Add exception-handling with human-readable error messages for end users</li>
<li>Output additional debugging info to the browser console for developers</li>
</ol>
<p><del>On the backend, that means adding a new exception that takes additional details, i.e., the user-facing error message and the console debugging details, and returns it in the form of JSON.</del> → <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/experience_builder/issues/3470995" title="Status: Closed (fixed)">#3470995: OpenAPI validation errors must be provided as a JSON response</a></span></p>
<p>On the front-end, that means translating the JSON into the error modal and console log.</p>
<h3 id="ui-changes">User interface changes</h3>
<p>UI changes are explicit in the proposal above.</p>
> Related issue: [Issue #3470898](https://www.drupal.org/node/3470898)
> Related issue: [Issue #3470995](https://www.drupal.org/node/3470995)
> Related issue: [Issue #3499931](https://www.drupal.org/node/3499931)
issue