Package: groovy.lang

## [Java] Class GroovyRuntimeException

- groovy.lang.GroovyRuntimeException

-     public class GroovyRuntimeException
      extends RuntimeException

  An exception thrown by the interpreter

- - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyRuntimeException()` Creates an empty runtime exception.
    `GroovyRuntimeException(String message)` Creates a runtime exception with the supplied message.
    `GroovyRuntimeException(String message, ASTNode node)` Creates a runtime exception with the supplied message and AST node.
    `GroovyRuntimeException(String message, Throwable cause)` Creates a runtime exception with the supplied message and cause.
    `GroovyRuntimeException(Throwable t)` Creates a runtime exception with the supplied cause.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `protected String` | `getLocationText()` Builds the source-location suffix appended to this exception's message when location data is available.
    `` | `public String` | `getMessage()` Returns the message including location information when available.
    `` | `public String` | `getMessageWithoutLocationText()` Returns the detail message without appended location information.
    `` | `public ModuleNode` | `getModule()` Returns the related module, if any.
    `` | `public ASTNode` | `getNode()` Returns the related AST node, if any.
    `` | `public void` | `setModule(ModuleNode module)` Sets the module used when reporting location information.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class RuntimeException` | `addSuppressed, equals, fillInStackTrace, getCause, getClass, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, hashCode, initCause, notify, notifyAll, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### public GroovyRuntimeException()

      Creates an empty runtime exception.

    - #### public GroovyRuntimeException(String message)

      Creates a runtime exception with the supplied message.

      Parameters:
        `message` - the detail message

    - #### public GroovyRuntimeException(String message, ASTNode node)

      Creates a runtime exception with the supplied message and AST node.

      Parameters:
        `message` - the detail message
        `node` - the related AST node

    - #### public GroovyRuntimeException(String message, Throwable cause)

      Creates a runtime exception with the supplied message and cause.

      Parameters:
        `message` - the detail message
        `cause` - the underlying cause

    - #### public GroovyRuntimeException(Throwable t)

      Creates a runtime exception with the supplied cause.

      Parameters:
        `t` - the underlying cause

  - ### Method Detail

    - #### protected String getLocationText()

      Builds the source-location suffix appended to this exception's message when location data is available.

      Returns:
        the formatted location text, or an empty string if no location is known

    - #### public String getMessage()

      Returns the message including location information when available.

      Returns:
        the formatted message

    - #### public String getMessageWithoutLocationText()

      Returns the detail message without appended location information.

      Returns:
        the raw detail message

    - #### public ModuleNode getModule()

      Returns the related module, if any.

      Returns:
        the related module

    - #### public ASTNode getNode()

      Returns the related AST node, if any.

      Returns:
        the related AST node

    - #### public void setModule(ModuleNode module)

      Sets the module used when reporting location information.

      Parameters:
        `module` - the related module