fix stream error handling

This commit is contained in:
team 1
2026-04-25 12:19:20 +02:00
parent 2f28ad0416
commit fa65417efe
9 changed files with 435 additions and 62 deletions

View File

@@ -0,0 +1,47 @@
<?php
declare(strict_types=1);
namespace App\Shopware;
use RuntimeException;
use Throwable;
final class StoreApiException extends RuntimeException
{
public function __construct(
string $message,
private readonly ?int $statusCode = null,
private readonly bool $serverFailure = false,
private readonly bool $utf8Failure = false,
private readonly bool $safeCriteriaRetryRecommended = false,
?Throwable $previous = null
) {
parent::__construct($message, 0, $previous);
}
public function getStatusCode(): ?int
{
return $this->statusCode;
}
public function isServerFailure(): bool
{
return $this->serverFailure;
}
public function isUtf8Failure(): bool
{
return $this->utf8Failure;
}
public function isSafeCriteriaRetryRecommended(): bool
{
return $this->safeCriteriaRetryRecommended;
}
public function isSystemFailure(): bool
{
return $this->serverFailure || $this->utf8Failure;
}
}