# Class BuildException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.gradle.tooling.GradleConnectionException
org.gradle.tooling.BuildException

All Implemented Interfaces:
  `Serializable`

public class BuildException extends GradleConnectionException
Thrown when a Gradle build fails or when a model cannot be built.

Since:
  1.0
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BuildException(String message, Throwable throwable)`
  Creates a new `BuildException`.
  `BuildException(String message, Throwable cause, Supplier<List<Failure>> failures)`
  Constructor.

- ## Method Summary

  ### Methods inherited from class GradleConnectionException

  `getFailures`

  ### Methods inherited from class Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### BuildException

    public BuildException(String message, Throwable throwable)
    Creates a new `BuildException`.
    Since:
      1.0

  - ### BuildException

    @Incubating public BuildException(String message, Throwable cause, Supplier<List<Failure>> failures)
    Constructor.
    Since:
      8.12