# Class ResourceException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.gradle.api.GradleException
org.gradle.api.resources.ResourceException

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `MissingResourceException`

public class ResourceException extends GradleException
Generic resource exception that all other resource-related exceptions inherit from.

Since:
  1.0
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResourceException()`
  Creates a new `ResourceException`.
  `ResourceException(String message)`
  Creates a new `ResourceException`.
  `ResourceException(String message, Throwable cause)`
  Creates a new `ResourceException`.
  `ResourceException(URI location, String message)`
  Creates a new `ResourceException`.
  `ResourceException(URI location, String message, Throwable cause)`
  Creates a new `ResourceException`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `@Nullable URI`
  `getLocation()`
  Returns the location of the resource, if known.

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

  - ### ResourceException

    public ResourceException()
    Creates a new `ResourceException`.
    Since:
      1.0

  - ### ResourceException

    public ResourceException(String message)
    Creates a new `ResourceException`.
    Since:
      1.0

  - ### ResourceException

    public ResourceException(String message, Throwable cause)
    Creates a new `ResourceException`.
    Since:
      1.0

  - ### ResourceException

    public ResourceException(URI location, String message)
    Creates a new `ResourceException`.
    Since:
      2.13

  - ### ResourceException

    public ResourceException(URI location, String message, Throwable cause)
    Creates a new `ResourceException`.
    Since:
      2.13

- ## Method Details

  - ### getLocation

    public @Nullable URI getLocation()
    Returns the location of the resource, if known.
    Returns:
      The location, or null if not known.
    Since:
      2.13