You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Swetha (Jira)" <ji...@apache.org> on 2020/05/07 10:16:00 UTC

[jira] [Commented] (OLINGO-1374) Include "target" in error response caused by exceptions (ODataLibraryException, DeserializerException)

    [ https://issues.apache.org/jira/browse/OLINGO-1374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17101510#comment-17101510 ] 

Swetha commented on OLINGO-1374:
--------------------------------

I am also facing this issue.

Is there any workaround to fix this issue?

> Include "target" in error response caused by exceptions (ODataLibraryException, DeserializerException)
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OLINGO-1374
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1374
>             Project: Olingo
>          Issue Type: Improvement
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.6.0
>            Reporter: Tobias Niehues
>            Priority: Major
>
> Error responses should include error codes and target to enable user interfaces to tie validation errors to the related interface element.
> For example: The xml and json implementations of ODataDeserializer throw DeserializerExceptions and include the offending property in the error message. However, this information does not get propagated to the error handler.
>  
> See: [https://github.com/apache/olingo-odata4/blob/master/lib/server-core/src/main/java/org/apache/olingo/server/core/ODataHandlerImpl.java#L81-L125] 
> DeserializerException is converted to ODataServerError, but it is not setting the ODataServerError.target attribute. This results in error messages like:
> {{{"error":\{"code":null,"message":"Property: Type must not be null."}}}}
> I would expect the error message to look like this:
> {{{"error":\{"code": "INVALID_NULL_PROPERTY","message":"Property: Type must not be null.", target: "Type"}}}}
>  
> As it is, I find it hard to customize error handling/validation as it is now. There is no nice way to replace ODataExceptionHelper, for example. 
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)