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

Tobias Niehues updated OLINGO-1374:
-----------------------------------
    Description: 
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 as it is now. There is no 
nice way to replace ODataExceptionHelper, for example. 

 

 

  was:
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."}}

```

As it is, I find it hard to customize error handling as it is now. There is no 
nice way to replace ODataExceptionHelper, for example. 

 


> 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 as it is now. There is 
> no nice way to replace ODataExceptionHelper, for example. 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to