public class Pp2ParseException extends RuntimeException
Pp2FormatOptions.tolerantMode is
false and parsing fails for one or more regions.
In tolerant mode (the default) parse failures are recovered by the
lexical fallback renderer and surfaced as
FormatDiagnostics on the result, not as
exceptions. Strict callers (e.g., CI lint that must reject malformed
SQL outright) opt out by flipping tolerantMode = false; they then
see this exception with the originating parser diagnostics attached.
Note: FormatDiagnostic is introduced in slice S3. Until S3 lands
this exception only carries the underlying parser
diagnostics; the result-shaped diagnostics will be wired in alongside
Pp2FormatResult.
| Constructor and Description |
|---|
Pp2ParseException(String message) |
Pp2ParseException(String message,
List<TSyntaxError> parserErrors) |
Pp2ParseException(String message,
Throwable cause) |
| Modifier and Type | Method and Description |
|---|---|
List<TSyntaxError> |
getParserErrors()
Immutable view of the parser diagnostics that triggered this failure.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic Pp2ParseException(String message)
public Pp2ParseException(String message, List<TSyntaxError> parserErrors)
public Pp2ParseException(String message, Throwable cause)
public List<TSyntaxError> getParserErrors()