2026-01-26 20:57:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-01-27 17:34:35 +00:00
|
|
|
namespace Core\Mcp\Exceptions;
|
2026-01-26 20:57:41 +00:00
|
|
|
|
|
|
|
|
use RuntimeException;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Exception thrown when the circuit breaker is open and no fallback is provided.
|
|
|
|
|
*
|
|
|
|
|
* This indicates the target service is temporarily unavailable due to repeated failures.
|
|
|
|
|
*/
|
|
|
|
|
class CircuitOpenException extends RuntimeException
|
|
|
|
|
{
|
|
|
|
|
public function __construct(
|
|
|
|
|
public readonly string $service,
|
|
|
|
|
string $message = '',
|
|
|
|
|
) {
|
|
|
|
|
$message = $message ?: sprintf(
|
|
|
|
|
"Service '%s' is temporarily unavailable. Please try again later.",
|
|
|
|
|
$service
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
parent::__construct($message);
|
|
|
|
|
}
|
|
|
|
|
}
|