optimize error handling if shop api error
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user