Package org.codehaus.groovy.syntax
Class RuntimeParserException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
groovy.lang.GroovyRuntimeException
org.codehaus.groovy.syntax.RuntimeParserException
- All Implemented Interfaces:
Serializable
A runtime exception wrapper for parser errors, allowing parser exceptions to be thrown
from contexts that cannot throw checked exceptions. Can be converted back to a
SyntaxException when needed for proper error handling.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRuntimeParserException(String message, ASTNode node) Constructs a RuntimeParserException from an error message and AST node. -
Method Summary
Modifier and TypeMethodDescriptionvoidConverts this runtime exception to a checkedSyntaxException.Methods inherited from class groovy.lang.GroovyRuntimeException
getLocationText, getMessage, getMessageWithoutLocationText, getModule, getNode, setModuleMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RuntimeParserException
Constructs a RuntimeParserException from an error message and AST node. The node's position information is included in the error message.- Parameters:
message- the error messagenode- theASTNodewhere the error occurred
-
-
Method Details
-
throwParserException
Converts this runtime exception to a checkedSyntaxException. Extracts position information from the associated AST node.- Throws:
SyntaxException- containing the error details from this runtime exception
-