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

NETCONF provider should raise more appropriate exceptions #774

Closed
111pontes opened this issue Apr 30, 2018 · 0 comments
Closed

NETCONF provider should raise more appropriate exceptions #774

111pontes opened this issue Apr 30, 2018 · 0 comments

Comments

@111pontes
Copy link
Collaborator

Somewhat related to #773

Current Behavior

XML output for rpc-error is used as exception message. For instance:

YServiceProviderError: <?xml version="1.0"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <rpc-error>
    <error-type>protocol</error-type>
    <error-tag>unknown-namespace</error-tag>
    <error-severity>error</error-severity>
    <error-info>
      <bad-element>netconf-state</bad-element>
      <bad-namespace>urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring2</bad-namespace>
    </error-info>
  </rpc-error>
</rpc-reply>

Expected Behavior

NETCONF service provide should define more specific exceptions that reflect the different types of transport/rpc/protocol/application errors as defined in RFC 6241

Users should be able to catch more specific exceptions if desired and the exception message in any case should be human-friendly instead of direct XML output from an rpc-reply.

Steps to Reproduce

Initiate a NETCONF RPC that results in a rpc-error message.

System Information

$ python --version
Python 3.5.2
$ pip list | grep ydk
ydk                     0.7.1
ydk-models-cisco-ios-xr 6.3.2
ydk-models-ietf         0.1.5
$
ygorelik pushed a commit to ygorelik/ydk-gen that referenced this issue Jul 17, 2019
@ygorelik ygorelik self-assigned this Jul 17, 2019
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

3 participants