Package org.apache.olingo.server.api
Class ODataServerError
java.lang.Object
org.apache.olingo.commons.api.ex.ODataError
org.apache.olingo.server.api.ODataServerError
Class to hold all server relevant error information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the exception.Gets the locale.int
Gets the status code.setAdditionalProperties
(Map<String, Object> additionalProperties) Sets server defined key-value pairs.The value for the code name/value pair is a language-independent string.setDetails
(List<ODataErrorDetail> details) Sets error details.setException
(Exception exception) Sets the exception.setInnerError
(Map<String, String> innerError) Sets server defined key-value pairs for debug environment only.Sets the locale.setMessage
(String message) The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error.setStatusCode
(int statusCode) Sets the status code.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
-
Constructor Details
-
ODataServerError
public ODataServerError()
-
-
Method Details
-
getLocale
Gets the locale.- Returns:
- the locale for the exception message
-
setLocale
Sets the locale.- Returns:
- this for method chaining
-
getException
Gets the exception.- Returns:
- the exception with its hierarchy
-
setException
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
Sets the status code.- Parameters:
statusCode
- the status code which this error results in- Returns:
- this for method chaining
-
setCode
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 classODataError
- Parameters:
code
- the service defined error code for this error- Returns:
- this for method chaining
-
setMessage
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 classODataError
- Parameters:
message
- message for this error- Returns:
- this for method chaining
-
setTarget
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 classODataError
- Parameters:
target
- target to which this error is related to- Returns:
- this for method chaining
-
setDetails
Sets error details.- Overrides:
setDetails
in classODataError
- Returns:
- this for method chaining.
-
setInnerError
Sets server defined key-value pairs for debug environment only.- Overrides:
setInnerError
in classODataError
- Returns:
- this for method chaining.
-
setAdditionalProperties
Sets server defined key-value pairs.- Overrides:
setAdditionalProperties
in classODataError
- Returns:
- this for method chaining.
-