Package org.codehaus.groovy
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
Base exception class for Groovy compiler errors and warnings.
Implements
GroovyExceptionInterface to track exception severity.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aGroovyExceptionwith no detail message or cause.GroovyException(boolean fatal) Constructs aGroovyExceptionwith the specified fatality flag.GroovyException(String message) Constructs aGroovyExceptionwith the specified detail message.GroovyException(String message, boolean fatal) Constructs aGroovyExceptionwith the specified detail message and fatality flag.GroovyException(String message, Throwable cause) Constructs aGroovyExceptionwith the specified detail message and cause. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
GroovyException
public GroovyException()Constructs aGroovyExceptionwith no detail message or cause. -
GroovyException
Constructs aGroovyExceptionwith the specified detail message.- Parameters:
message- the detail message describing this exception
-
GroovyException
Constructs aGroovyExceptionwith the specified detail message and cause.- Parameters:
message- the detail message describing this exceptioncause- the underlying cause of this exception
-
GroovyException
public GroovyException(boolean fatal) Constructs aGroovyExceptionwith the specified fatality flag.- Parameters:
fatal-trueif this exception should halt compilation;falseotherwise
-
GroovyException
Constructs aGroovyExceptionwith the specified detail message and fatality flag.- Parameters:
message- the detail message describing this exceptionfatal-trueif this exception should halt compilation;falseotherwise
-
-
Method Details
-
isFatal
public boolean isFatal()Returns whether this exception is fatal. A fatal exception typically causes compilation to stop.- Specified by:
isFatalin interfaceGroovyExceptionInterface- Returns:
trueif this exception is fatal;falseotherwise
-
setFatal
public void setFatal(boolean fatal) Sets whether this exception is fatal. A fatal exception typically causes compilation to stop.- Specified by:
setFatalin interfaceGroovyExceptionInterface- Parameters:
fatal-trueto mark this exception as fatal;falseotherwise
-