org.apache.olingo.server.api

## Class ODataApplicationException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.apache.olingo.commons.api.ex.ODataException
      - - org.apache.olingo.server.api.ODataApplicationException

- All Implemented Interfaces:
    Serializable

      public class ODataApplicationException
      extends ODataException

  Exception thrown by OData service implementations.
  See Also:
    `ODataException`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ODataApplicationException(String msg, int statusCode, Locale locale)` Exception in an OData service implementation.
    `ODataApplicationException(String msg, int statusCode, Locale locale, String oDataErrorCode)` Exception in an OData service implementation.
    `ODataApplicationException(String msg, int statusCode, Locale locale, Throwable cause)` Exception in an OData service implementation.
    `ODataApplicationException(String msg, int statusCode, Locale locale, Throwable cause, String oDataErrorCode)` Exception in an OData service implementation.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Locale` | `getLocale()` Returns the Locale which was used for the error message.
    `String` | `getODataErrorCode()` This method will return the error code specified by the application.
    `int` | `getStatusCode()` Will return the status code which will be used as a status code for the HTTP response.

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

    - #### ODataApplicationException

          public ODataApplicationException(String msg,
                                           int statusCode,
                                           Locale locale)

      Exception in an OData service implementation.
      Parameters:
        `msg` - the text of the exception
        `statusCode` - the HTTP status code of the error response; the default is 500 - Internal Server Error
        `locale` - a `Locale` to enable translation of error messages
      See Also:
        `ODataException`, `HttpStatusCode`

    - #### ODataApplicationException

          public ODataApplicationException(String msg,
                                           int statusCode,
                                           Locale locale,
                                           String oDataErrorCode)

      Exception in an OData service implementation.
      Parameters:
        `msg` - the text of the exception
        `statusCode` - the HTTP status code of the error response; the default is 500 - Internal Server Error
        `locale` - a `Locale` to enable translation of error messages
        `oDataErrorCode` - the error code of the exception as defined by the OData standard
      See Also:
        `ODataException`, `HttpStatusCode`

    - #### ODataApplicationException

          public ODataApplicationException(String msg,
                                           int statusCode,
                                           Locale locale,
                                           Throwable cause)

      Exception in an OData service implementation.
      Parameters:
        `msg` - the text of the exception
        `statusCode` - the HTTP status code of the error response; the default is 500 - Internal Server Error
        `locale` - a `Locale` to enable translation of error messages
        `cause` - the cause of this exception
      See Also:
        `ODataException`, `HttpStatusCode`, `Throwable.getCause()`

    - #### ODataApplicationException

          public ODataApplicationException(String msg,
                                           int statusCode,
                                           Locale locale,
                                           Throwable cause,
                                           String oDataErrorCode)

      Exception in an OData service implementation.
      Parameters:
        `msg` - the text of the exception
        `statusCode` - the HTTP status code of the error response; the default is 500 - Internal Server Error
        `locale` - a `Locale` to enable translation of error messages
        `cause` - the cause of this exception
        `oDataErrorCode` - the error code of the exception as defined by the OData standard
      See Also:
        `ODataException`, `HttpStatusCode`, `Throwable.getCause()`

  - ### Method Detail

    - #### getStatusCode

          public int getStatusCode()

      Will return the status code which will be used as a status code for the HTTP response. If not set the default is a 500 Internal Server Error.
      Returns:
        status code for this exception

    - #### getLocale

          public Locale getLocale()

      Returns the Locale which was used for the error message. The default is null.
      Returns:
        locale used for the error message

    - #### getODataErrorCode

          public String getODataErrorCode()

      This method will return the error code specified by the application. The default is null.
      Returns:
        the applications error code.

Copyright © 2013–2022 The Apache Software Foundation. All rights reserved.