abstract class SourceException
    extends RuntimeException
Public API: explicitly declared with @visibility public.

The SQL text could not be read at a position.

Both a lexer that meets text it cannot tokenize and a parser that meets a token it cannot accept report this way, so a caller can handle either.

Reporting where reading faileddoctest
$e = \SqlParser\Lexer\LexicalException::unterminated('string', "SELECT\n'abc", 7);
    $e instanceof \SqlParser\Lexer\SourceException // => true
    $e->position->line // => 2

Properties§

public int $offset
public SourcePosition $position

Methods§

public function __construct(
    string $message,
    public int $offset,
    public SourcePosition $position,
)

Parameters

$messagestringWhat went wrong
$offsetintByte offset where it went wrong
$positionSourcePositionThe same place as a line and column
Called from 1
Calls 1
  • static-call RuntimeException::__construct() line 34

Test cases 25§

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 24

Relations§

Extended by 2
Static calls 1