Handle error response from evaluating keywords
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3560531. -->
Reported by: [justafish](https://www.drupal.org/user/161058)
Related to !113
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>An error state can respond with a 200 and this in the response body:</p>
<pre>{<br> "status": "COMPLETED_WITH_ERROR",<br> "insightsStatus": "COMPLETED",<br> "snippetsStatus": "COMPLETED_WITH_ERROR",<br> "startTime": 1762442149800,<br> "progress": { "total": 2, "completed": 1, "error": 1 },<br> "insightsProgress": { "total": 0, "completed": 0, "error": 0 },<br> "snippetsProgress": { "total": 2, "completed": 1, "error": 1 },<br> "request": {<br> "insight": {<br> "accountId": 24936,<br> "input": {<br> "topic": {<br> "phrase": "AI in marketing",<br> "phrases": ["AI in marketing", "benefits of AI content"],<br> "rankSourceId": 1,<br> "isoLocale": "en_US",<br> "webPropertyId": 0,<br> "webPropertyName": null<br> },<br> "page": null<br> },<br> "request": { "insights": [], "snippets": ["MSV_SNIPPET", "OPPORTUNITIES_SNIPPET"] },<br> "userId": 1000011568<br> }<br> },<br> "results": {<br> "insights": [],<br> "snippets": [<br> {<br> "errorPhrases": ["benefits of AI content"],<br> "creationTime": 1762442155014,<br> "phraseDetails": [<br> {<br> "rootKeyword": "AI in marketing",<br> "topicSearchVolume": 2900,<br> "topicPhrase": "AI in marketing"<br> }<br> ],<br> "errorMessage": null,<br> "errorCode": null,<br> "details": {<br> "rootKeyword": "AI in marketing",<br> "topicSearchVolume": 2900,<br> "topicPhrase": "AI in marketing"<br> },<br> "type": "MSV_SNIPPET",<br> "status": "COMPLETED"<br> }<br> ],<br> "pages": {}<br> }<br>}</pre>
issue