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
ConstructorsConstructorDescriptionODataServiceError(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 booleanbooleanstatic ODataServiceErrorfromResultObject(ResultObject resultObject, ODataProtocol protocol) SDK internal method to construct an OData error from aResultObject.A list of all contained nestedODataServiceErrors.Theinnererrorfield 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.inthashCode()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 theerrordetailsfield ofinnererror.- Returns:
- A potentially empty List of error details.
- See Also:
-
getInnerError
Theinnererrorfield 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 fielderrordetailsis available separately viagetDetails().- Returns:
- A potentially empty Map containing the contents of the
innererrorfield. - 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- TheResultObjectthat should be parsed.protocol- TheOData protocol versionthat should be assumed.- Returns:
- A new
ODataServiceError. - Throws:
UnsupportedOperationException- if parsing the result object failed.
-
getTarget
Description copied from interface:ODataServiceErrorDetailsOptional OData service specific hint for origin of the error.- Specified by:
getTargetin interfaceODataServiceErrorDetails- Returns:
- An
optionaltarget.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getODataCode
Description copied from interface:ODataServiceErrorDetailsLanguage independent OData error response code.- Specified by:
getODataCodein interfaceODataServiceErrorDetails- Returns:
- The OData error code.
-
getODataMessage
Description copied from interface:ODataServiceErrorDetailsLanguage dependent OData error message. The language used is reflected by the "Content-Language" header in the HTTP response.- Specified by:
getODataMessagein interfaceODataServiceErrorDetails- Returns:
- The OData error message.
-