org.apache.olingo.server.api

## Class ODataServerError

- java.lang.Object
- - org.apache.olingo.commons.api.ex.ODataError
  - - org.apache.olingo.server.api.ODataServerError

-     public class ODataServerError
      extends ODataError

  Class to hold all server relevant error information.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ODataServerError()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Exception` | `getException()` Gets the exception.
    `Locale` | `getLocale()` Gets the locale.
    `int` | `getStatusCode()` Gets the status code.
    `ODataServerError` | `setAdditionalProperties(Map<String,Object> additionalProperties)` Sets server defined key-value pairs.
    `ODataServerError` | `setCode(String code)` The value for the code name/value pair is a language-independent string.
    `ODataServerError` | `setDetails(List<ODataErrorDetail> details)` Sets error details.
    `ODataServerError` | `setException(Exception exception)` Sets the exception.
    `ODataServerError` | `setInnerError(Map<String,String> innerError)` Sets server defined key-value pairs for debug environment only.
    `ODataServerError` | `setLocale(Locale locale)` Sets the locale.
    `ODataServerError` | `setMessage(String message)` The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.
    `ODataServerError` | `setStatusCode(int statusCode)` Sets the status code.
    `ODataServerError` | `setTarget(String target)` The value for the target name/value pair is the target of the particular error (for example, the name of the property in error).

    - ### Methods inherited from class org.apache.olingo.commons.api.ex.ODataError

      `getAdditionalProperties, getCode, getDetails, getInnerError, getMessage, getTarget`

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

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

- - ### Constructor Detail

    - #### ODataServerError

          public ODataServerError()

  - ### Method Detail

    - #### getLocale

          public Locale getLocale()

      Gets the locale.
      Returns:
        the locale for the exception message

    - #### setLocale

          public ODataServerError setLocale(Locale locale)

      Sets the locale.
      Returns:
        this for method chaining

    - #### getException

          public Exception getException()

      Gets the exception.
      Returns:
        the exception with its hierarchy

    - #### setException

          public ODataServerError setException(Exception exception)

      Sets the exception.
      Returns:
        this for method chaining

    - #### getStatusCode

          public int getStatusCode()

      Gets the status code.
      Returns:
        the status code which this error results in.

    - #### setStatusCode

          public ODataServerError setStatusCode(int statusCode)

      Sets the status code.
      Parameters:
        `statusCode` - the status code which this error results in
      Returns:
        this for method chaining

    - #### setCode

          public ODataServerError setCode(String code)

      The value for the code name/value pair is a language-independent string. Its value is a service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. MAY be null.
      Overrides:
        `setCode` in class `ODataError`
      Parameters:
        `code` - the service defined error code for this error
      Returns:
        this for method chaining

    - #### setMessage

          public ODataServerError setMessage(String message)

      The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error. MUST not be null.
      Overrides:
        `setMessage` in class `ODataError`
      Parameters:
        `message` - message for this error
      Returns:
        this for method chaining

    - #### setTarget

          public ODataServerError setTarget(String target)

      The value for the target name/value pair is the target of the particular error (for example, the name of the property in error). MAY be null.
      Overrides:
        `setTarget` in class `ODataError`
      Parameters:
        `target` - target to which this error is related to
      Returns:
        this for method chaining

    - #### setDetails

          public ODataServerError setDetails(List<ODataErrorDetail> details)

      Sets error details.
      Overrides:
        `setDetails` in class `ODataError`
      Returns:
        this for method chaining.

    - #### setInnerError

          public ODataServerError setInnerError(Map<String,String> innerError)

      Sets server defined key-value pairs for debug environment only.
      Overrides:
        `setInnerError` in class `ODataError`
      Returns:
        this for method chaining.

    - #### setAdditionalProperties

          public ODataServerError setAdditionalProperties(Map<String,Object> additionalProperties)

      Sets server defined key-value pairs.
      Overrides:
        `setAdditionalProperties` in class `ODataError`
      Returns:
        this for method chaining.

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