Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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()` Returns a description of the location of where this exception occurred.
`java.lang.String` | `getMessage()` Returns the fully formatted error message, including the location.
`java.lang.String` | `getOriginalMessage()` Returns the undecorated message of this exception.
`java.util.List` | `getReportableCauses()` Returns the reportable causes for this failure.
`org.gradle.groovy.scripts.ScriptSource` | `getScriptSource()` Returns the source of the script where this exception occurred.
`java.lang.Throwable` | `getTarget()` Returns the target exception.

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

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

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

Methods inherited from class java.lang.Object
java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString()

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