Class MultiStatementFailure

All Implemented Interfaces:
Serializable

public final class MultiStatementFailure extends RuntimeException
What a request carrying SEVERAL statements answers when one of them fails while running.

The account runs such a request through a helper of its own, and a failure inside it comes back naming the statement that failed and where it sits — its own text, its line, and its column within that line — with the statement's own error carried inside. The helper's name and its internal stack are part of the sentence the account produces, so they are part of this one too: a client that matches on the account's wording sees the same text here.

Only a failure DURING EXECUTION is spelled this way. A script whose text will not parse is refused as a whole before any of it runs, with an ordinary syntax error that names no statement, and a request carrying a single statement answers with that statement's own error unadorned.

See Also:
  • Method Details

    • wrapping

      public static RuntimeException wrapping(FrostlakeParser.SqlScriptContext tree, FrostlakeParser.StatementContext failing, RuntimeException failure, boolean topLevel)
      The failure to throw for a statement that failed inside a script of several statements: the account's sentence when this request carried more than one statement, and failure itself otherwise.
      Parameters:
      tree - the parsed script the statement belongs to
      failing - the statement that failed
      failure - what it failed with
      topLevel - whether this is the request's own script rather than a nested one
      Returns:
      the exception to throw