Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api
Class LocationAwareException

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

All Implemented Interfaces:
  Serializable

    public class LocationAwareException

extends GradleException

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

See Also:
  Serialized Form

Constructor Summary
`LocationAwareException(Throwable cause, Throwable target, org.gradle.groovy.scripts.ScriptSource source, Integer lineNumber)`

Method Summary
`Integer` | `getLineNumber()` Returns the line in the script where this exception occurred, if known.
`String` | `getLocation()` Returns a description of the location of where this exception occurred.
`String` | `getMessage()` Returns the fully formatted error message, including the location.
`String` | `getOriginalMessage()` Returns the undecorated message of this exception.
`List<Throwable>` | `getReportableCauses()` Returns the reportable causes for this failure.
`org.gradle.groovy.scripts.ScriptSource` | `getScriptSource()` Returns the source of the script where this exception occurred.
`Throwable` | `getTarget()` Returns the target exception.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### LocationAwareException

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

Method Detail

### getTarget

    public Throwable getTarget()

  Returns the target exception.

  Returns:
    The target exception. Not null

### getOriginalMessage

    public String getOriginalMessage()

  Returns the undecorated message of this exception.

  Returns:
    The undecorated message. May return null.

### getScriptSource

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

  Returns the source of the script where this exception occurred.

  Returns:
    The source. May return null.

### getLocation

    public String getLocation()

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

  Returns:
    The location description. May return null.

### getLineNumber

    public Integer getLineNumber()

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

  Returns:
    The line number, or null if not known.

### getMessage

    public String getMessage()

  Returns the fully formatted error message, including the location.

  Overrides:
    `getMessage` in class `Throwable`
  Returns:
    the message. May return null.

### getReportableCauses

    public List<Throwable> 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD