org.apache.olingo.odata2.api.exception

## Class ODataException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.apache.olingo.odata2.api.exception.ODataException

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    ODataApplicationException, ODataJPAException, ODataMessageException

      public class ODataException
      extends Exception

  Base exception for all `OData`-related exceptions.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ODataException()`
    `ODataException(String msg)`
    `ODataException(String msg, Throwable e)`
    `ODataException(Throwable e)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ODataApplicationException` | `getApplicationExceptionCause()` Search for and return first (from top) `ODataApplicationException` in the cause hierarchy.
    `ODataHttpException` | `getHttpExceptionCause()` Search for and return first (from top) `ODataHttpException` in the cause hierarchy.
    `ODataMessageException` | `getMessageExceptionCause()` Search for and return first (from top) `ODataMessageException` in the cause hierarchy.
    `boolean` | `isCausedByApplicationException()` Checks whether this exception is an or was caused by an `ODataApplicationException` exception.
    `boolean` | `isCausedByHttpException()` Checks whether this exception is an or was caused by an `ODataHttpException` exception.
    `boolean` | `isCausedByMessageException()` Checks whether this exception is an or was caused by an `ODataMessageException` exception.

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, 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

    - #### ODataException

          public ODataException()

    - #### ODataException

          public ODataException(String msg)

    - #### ODataException

          public ODataException(String msg,
                                Throwable e)

    - #### ODataException

          public ODataException(Throwable e)

  - ### Method Detail

    - #### isCausedByHttpException

          public boolean isCausedByHttpException()

      Checks whether this exception is an or was caused by an `ODataHttpException` exception.
      Returns:
        `true` if this is an or was caused by an `ODataHttpException`, otherwise `false`

    - #### getHttpExceptionCause

          public ODataHttpException getHttpExceptionCause()

      Search for and return first (from top) `ODataHttpException` in the cause hierarchy. If there is no `ODataHttpException` in the cause hierarchy, `NULL` is returned.
      Returns:
        the first found `ODataHttpException` in the cause exception hierarchy or `NULL` if no `ODataHttpException` is found in the cause hierarchy

    - #### isCausedByApplicationException

          public boolean isCausedByApplicationException()

      Checks whether this exception is an or was caused by an `ODataApplicationException` exception.
      Returns:
        `true` if this is an or was caused by an `ODataApplicationException`, otherwise `false`

    - #### isCausedByMessageException

          public boolean isCausedByMessageException()

      Checks whether this exception is an or was caused by an `ODataMessageException` exception.
      Returns:
        `true` if this is an or was caused by an `ODataMessageException`, otherwise `false`

    - #### getMessageExceptionCause

          public ODataMessageException getMessageExceptionCause()

      Search for and return first (from top) `ODataMessageException` in the cause hierarchy. If there is no `ODataMessageException` in the cause hierarchy `NULL` is returned.
      Returns:
        the first found `ODataMessageException` in the cause exception hierarchy or `NULL` if no `ODataMessageException` is found in the cause hierarchy

    - #### getApplicationExceptionCause

          public ODataApplicationException getApplicationExceptionCause()

      Search for and return first (from top) `ODataApplicationException` in the cause hierarchy. If there is no `ODataApplicationException` in the cause hierarchy `NULL` is returned.
      Returns:
        the first found `ODataApplicationException` in the cause exception hierarchy or `NULL` if no `ODataApplicationException` is found in the cause hierarchy

Copyright © 2013-2023 The Apache Software Foundation. All Rights Reserved.