[NETCONF-786] ODL does not consider error-msg statement in yang file at RESTCONF Created: 24/Jun/21  Updated: 08/Jul/21  Resolved: 29/Jun/21

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: 2.0.0, 1.13.3

Type: Bug Priority: Medium
Reporter: Onur GURSOY Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: restconf
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to YANGTOOLS-1300 Codecs report wrong error-type in Yan... Resolved
relates to YANGTOOLS-1301 YangError does not report error-tag Resolved

 Description   

Describe the bug
ODL returns default error (or generated by itself) to client.

I have yang file like this:

If i make request like this:

I got this error:

But if make request with other netconf client, i got correct error:

Expected behavior
We should see error message which is in the yang file



 Comments   
Comment by Robert Varga [ 24/Jun/21 ]

It would seem the exception handling code does not recognize YangInvalidValueException, or more specifically yang.common.YangError being attached to an exception.

Comment by Onur GURSOY [ 24/Jun/21 ]

you're master, you're right. In that case, what we can do ? we can release hottfix or we should wait next release date? I guess, it can be 27 July, right? Or we can release a patch unofficial?

Btw, you can describe that where is the exception handling code ? you know that there are many project and source of the ODL.Maybe, I can try to help.

Many thanks,

With My Best Regards,

Comment by Robert Varga [ 28/Jun/21 ]

The error handling is quite tricky here, but https://git.opendaylight.org/gerrit/c/netconf/+/96683 should work for this particular case.

Generated at Wed Feb 07 20:15:54 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.