final class SemanticException
    extends RuntimeException
Public API: explicitly declared with @visibility public.

An explicit semantic failure; callers must not treat a rejected tree as bound.

Reading semantic factsdoctest
$source = new \SqlParser\Parser\Node('expr', 0, []);
    $error = new \SqlSemantics\Core\SemanticException('unknown-column', 'Missing column', $source);
    $error->reason // => 'unknown-column'

Properties§

public string $reason
public Node|Token|Element $source

Methods§

public function __construct(
    public string $reason,
    string $message,
    public Node|Token|Element $source,
)

Parameters

$reasonstringStable machine-readable failure code
$messagestringHuman-readable explanation
$sourceNode|Token|ElementOriginal syntax responsible for the failure
Calls 1
  • static-call RuntimeException::__construct() line 34

Test cases 70§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 69

Relations§

Instantiated in 17