You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Ramesh Reddy (JIRA)" <ji...@apache.org> on 2016/03/29 14:52:25 UTC

[jira] [Resolved] (OLINGO-920) Different error code dependent from response format

     [ https://issues.apache.org/jira/browse/OLINGO-920?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ramesh Reddy resolved OLINGO-920.
---------------------------------
    Resolution: Duplicate
      Assignee: Ramesh Reddy

Duplicate of OLINGO-906

> Different error code dependent from response format
> ---------------------------------------------------
>
>                 Key: OLINGO-920
>                 URL: https://issues.apache.org/jira/browse/OLINGO-920
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.1.0
>            Reporter: Piotr Frelek
>            Assignee: Ramesh Reddy
>            Priority: Minor
>
> Error code in response is dependent from data format. For e.g.
> {code:xml}
> <error xmlns="http://docs.oasis-open.org/odata/ns/metadata">
> <code>404</code>
> <message>Resource not found</message>
> </error>
> {code}
> {code:JavaScript}
> {
>  "error":{
>       "code":null,
>       "message":"Resource not found"
>   }
> }
> {code}
> The reason of the problem is in implementation of serializers.
> XML serializer use error.getStatusCode().
> {code:title=ODataXmlSerializer.java}
> writer.writeDefaultNamespace("http://docs.oasis-open.org/odata/ns/metadata");
>                 this.writeErrorDetails(String.valueOf(error.getStatusCode()), error.getMessage(), error.getTarget(), writer);
>                 if(error.getDetails() != null && !error.getDetails().isEmpty()) {
> {code}
> JSON serializer calls ODateErrorSerializer which is using error.getCode().
> {code:title=ODataErrorSerializer.java}
> json.writeStartObject();
>             this.writeODataError(json, error.getCode(), error.getMessage(), error.getTarget());
>             if(error.getDetails() != null) {
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)