packages/sql-catalog/src/Cli/WriteFailureException.php

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