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

## 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.
`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
toString, printStackTrace, printStackTrace, printStackTrace, fillInStackTrace, getCause, getMessage, getLocalizedMessage, initCause, getStackTrace, setStackTrace, hashCode, getClass, equals, wait, wait, wait, notify, notifyAll

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

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

Methods inherited from class java.lang.Object
hashCode, getClass, equals, toString, wait, wait, wait, 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()

### getOriginalMessage

    public java.lang.String getOriginalMessage()

  Returns the undecorated message of this exception.

  return:
    The undecorated message. Never returns null.

### 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