Dyutiman Chaudhuri created OLINGO-1419:
------------------------------------------
Summary: Get annotated object from OData error response
Key: OLINGO-1419
URL: https://issues.apache.org/jira/browse/OLINGO-1419
Project: Olingo
Issue Type: Improvement
Components: odata4-client
Affects Versions: (Java) V4 4.5.0
Environment: Java
Reporter: Dyutiman Chaudhuri
Fix For: (Java) V4 4.5.0
OData error responses may contain annotations in any of its JSON objects. This
is from the OData JSON format document (Section 21.1)
[http://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html#sec_ErrorResponse]
This is very important specially for Client Errors (HTTP code 4xx) when the
server wants to pass some more information along with the standard error
properties.
I am working with Redfish APIs, which is built on top of OData protocol. The
Redfish error response always contains an annotated object associated with it.
From it's specification document the error object has the following properties:
||Property||Description||
|code|String. Defines a MessageId from the Message Registry.|
|message|Displays a human-readable error message that corresponds to the
Message in the Message Registry.|
|@Message.ExtendedInfo|Displays an array of Message objects. Describes one or
more error messages.|
In Olingo, when we are getting the ODataClientErrorException object, it
contains all the properties as specified by OData protocol, like code, messege,
target, list of details and innererror. But when the error response contains an
annotated object, like from Redfish, we are not able to get hold of it through
ODataClientErrorException object. Also there is no way to get the Raw error
response back, so that we can retrieve the annotated object from it.
I my case it has become a hurdle to get the annotated object from error
response. I could not find any way to get hold of it while using Olingo. And I
think it will be very helpful and sometimes necessary to include the annotated
object some how in the ODataClientErrorException object. It may include an
Olingo Entity, from where we can retrieve the data.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)