fix sse error handling if shop api error part 3
This commit is contained in:
@@ -156,7 +156,7 @@ final readonly class AgentRunner
|
||||
|
||||
yield $this->systemMsg(
|
||||
$this->buildShopUnavailableMessage($primaryShopSearchFailureReason),
|
||||
'info'
|
||||
'err'
|
||||
);
|
||||
|
||||
$repairPayload = [
|
||||
@@ -811,12 +811,21 @@ final readonly class AgentRunner
|
||||
|
||||
private function buildUserErrorMessage(Throwable $e): string
|
||||
{
|
||||
$message = trim($e->getMessage());
|
||||
|
||||
if ($message === '') {
|
||||
$message = $e::class;
|
||||
}
|
||||
|
||||
$safeMessage = htmlspecialchars($message, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
|
||||
if (!$this->debug) {
|
||||
return $this->agentRunnerConfig->getGenericInternalErrorMessage();
|
||||
return $this->agentRunnerConfig->getGenericInternalErrorMessage()
|
||||
. '<br><small>Technischer Fehler: ' . $safeMessage . '</small>';
|
||||
}
|
||||
|
||||
return $this->agentRunnerConfig->getDebugInternalErrorPrefix()
|
||||
. htmlspecialchars($e->getMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
|
||||
. $safeMessage;
|
||||
}
|
||||
|
||||
private function badge(string $label): string
|
||||
|
||||
Reference in New Issue
Block a user