Class GroovyException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.codehaus.groovy.GroovyException
All Implemented Interfaces:
Serializable, GroovyExceptionInterface
Direct Known Subclasses:
InvalidOptionException, ReadException, SyntaxException

public class GroovyException extends Exception implements GroovyExceptionInterface
Base exception class for Groovy compiler errors and warnings. Implements GroovyExceptionInterface to track exception severity.
See Also:
  • Constructor Details

    • GroovyException

      public GroovyException()
      Constructs a GroovyException with no detail message or cause.
    • GroovyException

      public GroovyException(String message)
      Constructs a GroovyException with the specified detail message.
      Parameters:
      message - the detail message describing this exception
    • GroovyException

      public GroovyException(String message, Throwable cause)
      Constructs a GroovyException with the specified detail message and cause.
      Parameters:
      message - the detail message describing this exception
      cause - the underlying cause of this exception
    • GroovyException

      public GroovyException(boolean fatal)
      Constructs a GroovyException with the specified fatality flag.
      Parameters:
      fatal - true if this exception should halt compilation; false otherwise
    • GroovyException

      public GroovyException(String message, boolean fatal)
      Constructs a GroovyException with the specified detail message and fatality flag.
      Parameters:
      message - the detail message describing this exception
      fatal - true if this exception should halt compilation; false otherwise
  • Method Details

    • isFatal

      public boolean isFatal()
      Returns whether this exception is fatal. A fatal exception typically causes compilation to stop.
      Specified by:
      isFatal in interface GroovyExceptionInterface
      Returns:
      true if this exception is fatal; false otherwise
    • setFatal

      public void setFatal(boolean fatal)
      Sets whether this exception is fatal. A fatal exception typically causes compilation to stop.
      Specified by:
      setFatal in interface GroovyExceptionInterface
      Parameters:
      fatal - true to mark this exception as fatal; false otherwise