Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
(Java) V4 4.6.0
-
None
-
None
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.
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.