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 Details

    • ODataServerError

      public ODataServerError()
  • Method Details

    • 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.