Groovy Documentation

org.gradle.api
Class GradleScriptException

java.lang.Object
  java.lang.Throwable
      java.lang.Exception
          java.lang.RuntimeException
              org.gradle.api.GradleException
                  org.gradle.api.GradleScriptException

class GradleScriptException
extends GradleException

A GradleScriptException is thrown when an exception occurs in the parsing or execution of a script.

author:
Hans Dockter


Constructor Summary
GradleScriptException(java.lang.String message, java.lang.Throwable cause, ScriptSource scriptSource)

GradleScriptException(java.lang.String message, java.lang.Throwable cause, ScriptSource scriptSource, java.lang.Integer lineNumber)

 
Method Summary
java.lang.Integer getLineNumber()

Returns the line in the script where this exception occurred, if known.

java.lang.String getLocation()

Returns a description of the location of where this execption occurred.

java.lang.String getMessage()

{

java.lang.String getOriginalMessage()

Returns the undecorated message of this exception.

List getReportableCauses()

Returns the reportable causes for this failure.

GradleScriptException getReportableException()

Returns the reportable exception for this failure.

ScriptSource getScriptSource()

Returns the source the script where this of this exception occurred.

 
Methods inherited from class java.lang.RuntimeException
printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, initCause, toString, getMessage, getLocalizedMessage, getStackTrace, setStackTrace, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll
 
Methods inherited from class java.lang.Exception
printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, initCause, toString, getMessage, getLocalizedMessage, getStackTrace, setStackTrace, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll
 
Methods inherited from class java.lang.Throwable
printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, initCause, toString, getMessage, getLocalizedMessage, getStackTrace, setStackTrace, wait, wait, wait, hashCode, getClass, equals, notify, notifyAll
 
Methods inherited from class java.lang.Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Constructor Detail

GradleScriptException

public GradleScriptException(java.lang.String message, java.lang.Throwable cause, ScriptSource scriptSource)


GradleScriptException

public GradleScriptException(java.lang.String message, java.lang.Throwable cause, ScriptSource scriptSource, java.lang.Integer lineNumber)


 
Method Detail

getLineNumber

public java.lang.Integer getLineNumber()
Returns the line in the script where this exception occurred, if known.
return:
The line number, or null if not known.


getLocation

public java.lang.String getLocation()

Returns a description of the location of where this execption occurred.

return:
The location description. Never returns null.


getMessage

public java.lang.String getMessage()
{@inheritDoc}


getOriginalMessage

public java.lang.String getOriginalMessage()

Returns the undecorated message of this exception.

return:
The undecorated message. Never returns null.


getReportableCauses

public List getReportableCauses()
Returns the reportable causes for this failure.
return:
The causes. Never returns null, returns an empty list if this exception has no reportable causes.


getReportableException

public GradleScriptException getReportableException()
Returns the reportable exception for this failure. Usually, a {code GradleScriptException} is simply a wrapper around the actual failure. This method locates the actual failure in the cause chain of this exception. May return this exception.
return:
The reportable exception. Never returns null.


getScriptSource

public ScriptSource getScriptSource()

Returns the source the script where this of this exception occurred.

return:
The source. Never returns null.


 

Groovy Documentation