Package dev.frostlake.executor
Class MultiStatementFailure
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.frostlake.executor.MultiStatementFailure
- All Implemented Interfaces:
Serializable
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 Summary
Modifier and TypeMethodDescriptionstatic RuntimeExceptionwrapping(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, andfailureitself otherwise.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
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, andfailureitself otherwise.- Parameters:
tree- the parsed script the statement belongs tofailing- the statement that failedfailure- what it failed withtopLevel- whether this is the request's own script rather than a nested one- Returns:
- the exception to throw
-