packages/sql-catalog/src/Core/Source/SourceScanException.php

1<?php
2
3declare(strict_types=1);
4
5namespace SqlCatalog\Core\Source;
6
7use RuntimeException;
8
9/**
10 * A path the scanner was asked to read and could not.
11 *
12 * @visibility root
13 */
14final class SourceScanException extends RuntimeException
15{
16    /**
17     * @param string $path The path that could not be read
18     * @param string $reason Why it could not be read
19     */
20    public function __construct(
21        public readonly string $path,
22        string $reason,
23    ) {
24        parent::__construct(sprintf('Cannot read "%s": %s.', $path, $reason));
25    }
26}
27