Class ODataServiceError
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.client.exception.ODataServiceError
- All Implemented Interfaces:
ODataServiceErrorDetails
OData error to serve the standard specification.
-
Constructor Summary
ConstructorDescriptionODataServiceError
(String oDataCode, String oDataMessage, String target) ODataServiceError
(String oDataCode, String oDataMessage, String target, List<ODataServiceErrorDetails> details, Map<String, Object> innerError) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
static ODataServiceError
fromResultObject
(ResultObject resultObject, ODataProtocol protocol) SDK internal method to construct an OData error from aResultObject
.A list of all contained nestedODataServiceErrors
.Theinnererror
field of the response as a key-value map.Language independent OData error response code.Language dependent OData error message.io.vavr.control.Option<String>
Optional OData service specific hint for origin of the error.int
hashCode()
toString()
-
Constructor Details
-
ODataServiceError
-
ODataServiceError
-
-
Method Details
-
getDetails
A list of all contained nestedODataServiceErrors
. If none were found in the response this list is empty. In case of OData V2 this corresponds to theerrordetails
field ofinnererror
.- Returns:
- A potentially empty List of error details.
- See Also:
-
getInnerError
Theinnererror
field of the response as a key-value map. If this field was not present on the response this map will be empty. In case of OData V2 the nested fielderrordetails
is available separately viagetDetails()
.- Returns:
- A potentially empty Map containing the contents of the
innererror
field. - See Also:
-
fromResultObject
@Nonnull public static ODataServiceError fromResultObject(@Nonnull ResultObject resultObject, @Nonnull ODataProtocol protocol) throws UnsupportedOperationException SDK internal method to construct an OData error from aResultObject
.- Parameters:
resultObject
- TheResultObject
that should be parsed.protocol
- TheOData protocol version
that should be assumed.- Returns:
- A new
ODataServiceError
. - Throws:
UnsupportedOperationException
- if parsing the result object failed.
-
getTarget
Description copied from interface:ODataServiceErrorDetails
Optional OData service specific hint for origin of the error.- Specified by:
getTarget
in interfaceODataServiceErrorDetails
- Returns:
- An
optional
target.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getODataCode
Description copied from interface:ODataServiceErrorDetails
Language independent OData error response code.- Specified by:
getODataCode
in interfaceODataServiceErrorDetails
- Returns:
- The OData error code.
-
getODataMessage
Description copied from interface:ODataServiceErrorDetails
Language dependent OData error message. The language used is reflected by the "Content-Language" header in the HTTP response.- Specified by:
getODataMessage
in interfaceODataServiceErrorDetails
- Returns:
- The OData error message.
-