1: <?php declare(strict_types=1);
2:
3: namespace Salient\Sync\Exception;
4:
5: use Salient\Contract\Sync\Exception\UnreachableBackendExceptionInterface;
6: use Salient\Contract\Sync\SyncProviderInterface;
7: use Throwable;
8:
9: /**
10: * @api
11: */
12: class UnreachableBackendException extends AbstractSyncException implements UnreachableBackendExceptionInterface
13: {
14: protected SyncProviderInterface $Provider;
15:
16: public function __construct(
17: SyncProviderInterface $provider,
18: string $message = '',
19: ?Throwable $previous = null
20: ) {
21: $this->Provider = $provider;
22:
23: parent::__construct($message, $previous);
24: }
25:
26: public function getProvider(): SyncProviderInterface
27: {
28: return $this->Provider;
29: }
30:
31: /**
32: * @inheritDoc
33: */
34: public function getMetadata(): array
35: {
36: return [
37: 'Provider' => $this->getProviderName($this->Provider),
38: ];
39: }
40: }
41: