-
Notifications
You must be signed in to change notification settings - Fork 78
NETCONF provider should raise more appropriate exceptions #774
Copy link
Copy link
Closed
Description
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
$
Reactions are currently unavailable