Uncaught exception in settings service with invalid api key and secret
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3586024. -->
Reported by: [isholgueras](https://www.drupal.org/user/733162)
Related to !166
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When a site has invalid Conductor API credentials configured (e.g. wrong key or secret), any operation that calls ConductorHttpApiClient::getAccountId() results in a 500 error. The Drupal logs show:</p>
<p>Client error: `GET <a href="https://api.conductor.com/v3/accounts?apiKey=…&sig=…">https://api.conductor.com/v3/accounts?apiKey=…&sig=…</a>` resulted in a `404 Not Found` response</p>
<p>This happens because the Guzzle request in getAccountId() does not set 'http_errors' => FALSE. Guzzle throws a ClientException on any 4xx response. That exception propagates to callers as a 500 instead of being handled gracefully. </p>
<p>The forward() method in the same class already uses <code>'http_errors' => FALSE</code> and checks the status code manually getAccountId() was inconsistent with that pattern.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<p> 1. Install Conductor and configure it with an invalid API key and secret (e.g. test / test).<br>
2. Trigger any action that calls getAccountId() (e.g. opening the Conductor sidebar in the Canvas editor).<br>
3. Observe a 500 error for the /conductor/api/settings route. The Drupal log contains the raw Guzzle exception message. </p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Add 'http_errors' => FALSE to the Guzzle request in getAccountId() and check the response status code before parsing the body. Throw ConductorCredentialsNotFoundException on 4xx responses so callers handle it consistently with other credential errors. </p>
issue