25 lines
508 B
PHP
25 lines
508 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Exceptions;
|
||
|
|
|
||
|
|
use RuntimeException;
|
||
|
|
|
||
|
|
class PromptRenderException extends RuntimeException
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @param list<string> $missingVariables
|
||
|
|
*/
|
||
|
|
public function __construct(public readonly array $missingVariables)
|
||
|
|
{
|
||
|
|
parent::__construct('Missing variables: ' . implode(', ', $missingVariables));
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @param list<string> $missing
|
||
|
|
*/
|
||
|
|
public static function missing(array $missing): self
|
||
|
|
{
|
||
|
|
return new self($missing);
|
||
|
|
}
|
||
|
|
}
|