optimize error handling if shop api error

This commit is contained in:
team 1
2026-04-25 18:37:29 +02:00
parent b9252202eb
commit 93ff6262cc
3 changed files with 31 additions and 15 deletions

View File

@@ -103,13 +103,14 @@ final class ShopSearchService
);
if ($this->lastSearchHadSystemFailure) {
$this->logger->warning('Shop search stopped after Store API system failure during reference probe', [
$this->logger->warning('Shop search reference probe failed, continuing with primary search', [
'commerceIntent' => $commerceIntent,
'originalPrompt' => $originalPrompt,
'failureReason' => $this->lastSearchFailureReason,
]);
//return [];
// A reference probe is only an enrichment step. It must not block the primary shop search.
$this->resetLastSearchFailure();
}
$rankedProducts = $this->executeSearch(
@@ -238,17 +239,6 @@ final class ShopSearchService
false
);
if ($this->lastSearchHadSystemFailure) {
$this->logger->warning('Shop reference probe stopped after Store API system failure', [
'commerceIntent' => $commerceIntent,
'originalPrompt' => $originalPrompt,
'referenceSearchText' => $referenceSearchText,
'failureReason' => $this->lastSearchFailureReason,
]);
break;
}
if ($results !== []) {
$allResults = array_merge($allResults, $results);
}