Groovy Documentation

org.gradle.api
[Java] Class LocationAwareException

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

public class LocationAwareException
extends GradleException

A LocationAwareException is an exception which can be annotated with a location in a script.


Constructor Summary
LocationAwareException(java.lang.Throwable cause, java.lang.Throwable target, org.gradle.groovy.scripts.ScriptSource source, 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()

java.lang.String getMessage()

Returns the fully formatted error message, including the location.

java.lang.String getOriginalMessage()

java.util.List getReportableCauses()

Returns the reportable causes for this failure.

org.gradle.groovy.scripts.ScriptSource getScriptSource()

java.lang.Throwable getTarget()

Returns the target exception.

 
Methods inherited from class java.lang.RuntimeException
java.lang.RuntimeException#printStackTrace(java.io.PrintStream), java.lang.RuntimeException#printStackTrace(), java.lang.RuntimeException#printStackTrace(java.io.PrintWriter), java.lang.RuntimeException#fillInStackTrace(), java.lang.RuntimeException#getCause(), java.lang.RuntimeException#initCause(java.lang.Throwable), java.lang.RuntimeException#toString(), java.lang.RuntimeException#getMessage(), java.lang.RuntimeException#getLocalizedMessage(), java.lang.RuntimeException#getStackTrace(), java.lang.RuntimeException#setStackTrace([Ljava.lang.StackTraceElement;), java.lang.RuntimeException#wait(), java.lang.RuntimeException#wait(long), java.lang.RuntimeException#wait(long, int), java.lang.RuntimeException#equals(java.lang.Object), java.lang.RuntimeException#hashCode(), java.lang.RuntimeException#getClass(), java.lang.RuntimeException#notify(), java.lang.RuntimeException#notifyAll()
 

Constructor Detail

LocationAwareException

public LocationAwareException(java.lang.Throwable cause, java.lang.Throwable target, org.gradle.groovy.scripts.ScriptSource source, java.lang.Integer lineNumber)


 
Method Detail

getLineNumber

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


getLocation

public java.lang.String getLocation()

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

Returns:
The location description. May return null.


getMessage

public java.lang.String getMessage()
Returns the fully formatted error message, including the location.
Returns:
the message. May return null.


getOriginalMessage

public java.lang.String getOriginalMessage()

Returns the undecorated message of this exception.

Returns:
The undecorated message. May return null.


getReportableCauses

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


getScriptSource

public org.gradle.groovy.scripts.ScriptSource getScriptSource()

Returns the source of the script where this exception occurred.

Returns:
The source. May return null.


getTarget

public java.lang.Throwable getTarget()
Returns the target exception.
Returns:
The target exception. Not null


 

Groovy Documentation