Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include additional data in ydk exception #381

Closed
ghost opened this issue Feb 16, 2017 · 1 comment
Closed

Include additional data in ydk exception #381

ghost opened this issue Feb 16, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 16, 2017

Related to #23.

There are multiple instances where xml output returned by the router is in-correct. Consequently, ydk returns 'YPYModelError: 0 already in list'. In such instances, it will be good to get the xml output in raw format.

It may be a valid approach to include extra data (like invalid XML) in the python exception. see for example: http://legacy.python.org/dev/peps/pep-0473/. Maybe we should reopen this issue on the ydk-gen repo?

@ghost
Copy link
Author

ghost commented Mar 24, 2017

The error raised when doing crud.read on faulty XML now includes the faulty XML payload. This can be used by code similar to below

try:
    res = crud.read(provider, obj)
catch YPYModelError as err:
   print(err.msg, err.payload)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

0 participants