RegionExistsException (Apache Geode 1.13.3)
Date: 2021-06-22

org.apache.geode.cache

## Class RegionExistsException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.apache.geode.GemFireException
        - - org.apache.geode.cache.CacheException
          - - org.apache.geode.cache.RegionExistsException

- All Implemented Interfaces:
    Serializable

      public class RegionExistsException
      extends CacheException

  Indicates that the requested region already exists when a region is being created.
  Since:
    GemFire 2.0
  See Also:
    `Region.createSubregion(java.lang.String, org.apache.geode.cache.RegionAttributes<SK, SV>)`, `Cache.createRegion(java.lang.String, org.apache.geode.cache.RegionAttributes<K, V>)`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegionExistsException(Region rgn)` Constructs an instance of `RegionExistsException` with the specified Region.
    `RegionExistsException(Region rgn, Throwable cause)` Constructs an instance of `RegionExistsException` with the specified detail message and cause.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Region` | `getRegion()` Return the Region that already exists which prevented region creation.

    - ### Methods inherited from class org.apache.geode.cache.CacheException

      `toString`

    - ### Methods inherited from class org.apache.geode.GemFireException

      `getRootCause`

    - ### Methods inherited from class java.lang.Throwable

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

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### RegionExistsException

          public RegionExistsException(Region rgn)

      Constructs an instance of `RegionExistsException` with the specified Region.
      Parameters:
        `rgn` - the Region that exists

    - #### RegionExistsException

          public RegionExistsException(Region rgn,
                                       Throwable cause)

      Constructs an instance of `RegionExistsException` with the specified detail message and cause.
      Parameters:
        `rgn` - the Region that exists
        `cause` - the causal Throwable

  - ### Method Detail

    - #### getRegion

          public Region getRegion()

      Return the Region that already exists which prevented region creation.
      Returns:
        the Region that already exists, or null if this exception has been serialized, in which `Throwable.getMessage()` will return the pathFromRoot for the region that exists.