<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python/Zeep - failing to trap failure on getLine for non-existent in Management</title>
    <link>https://community.cisco.com/t5/management/python-zeep-failing-to-trap-failure-on-getline-for-non-existent/m-p/4776738#M4036</link>
    <description>&lt;P&gt;Excellent, thanks! I wish I had a better grasp of where to look for this sort of thing on my own. I swear I tried google and searching the community. It doesn't help that I'll have some tasks that I need to do where Python is the perfect tool, and then I might not touch it for months. Thanks again.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2023 12:17:02 GMT</pubDate>
    <dc:creator>Elliot Dierksen</dc:creator>
    <dc:date>2023-02-16T12:17:02Z</dc:date>
    <item>
      <title>Python/Zeep - failing to trap failure on getLine for non-existent DN</title>
      <link>https://community.cisco.com/t5/management/python-zeep-failing-to-trap-failure-on-getline-for-non-existent/m-p/4776235#M4034</link>
      <description>&lt;P&gt;I have been staring at the AXL schema, but I am not making heads or tails of it. I am trying to figure out what error I should trap when I do a getLine for a DN that doesn't exist. This is the code fragment I have at the moment.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;try:
    adn_search2 = source_axl.getLine(pattern=next_agent_dn,routePartitionName=csf_partition)
except Fault:
    print('adn_search2 failed')
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;This is the error I am getting.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Traceback (most recent call last):
  File "/usr/home/ebd/CLAUTO/CUCM/./x2e_build.py", line 265, in main
    adn_search2 = source_axl.getLine(pattern=next_agent_dn,routePartitionName=csf_partition)
  File "/usr/local/lib/python3.9/site-packages/zeep/proxy.py", line 46, in __call__
    return self._proxy._binding.send(
  File "/usr/local/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 135, in send
    return self.process_reply(client, operation_obj, response)
  File "/usr/local/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
    return self.process_error(doc, operation)
  File "/usr/local/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 329, in process_error
    raise Fault(
zeep.exceptions.Fault: Item not valid: The specified Line was not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/home/ebd/CLAUTO/CUCM/./x2e_build.py", line 592, in &amp;lt;module&amp;gt;
    main()
  File "/usr/home/ebd/CLAUTO/CUCM/./x2e_build.py", line 266, in main
    except Fault:
NameError: name 'Fault' is not defined
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;I freely admit that perhaps I am reading the AXL schema incorrectly, but I can't figure out what exception I should try to catch. I even tried looking at ciscoaxl/schema/10.5/AXLSoap.xsd but the answer is still evading me.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 21:34:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-zeep-failing-to-trap-failure-on-getline-for-non-existent/m-p/4776235#M4034</guid>
      <dc:creator>Elliot Dierksen</dc:creator>
      <dc:date>2023-02-15T21:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Python/Zeep - failing to trap failure on getLine for non-existent</title>
      <link>https://community.cisco.com/t5/management/python-zeep-failing-to-trap-failure-on-getline-for-non-existent/m-p/4776495#M4035</link>
      <description>&lt;P&gt;Hello Elliot!&lt;BR /&gt;That's no problem, that's what the community is there for!&lt;/P&gt;
&lt;P&gt;You get a zeep exception!&lt;BR /&gt;&lt;STRONG&gt;zeep.exceptions.Fault: Item not valid: The specified Line was not found&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; &amp;nbsp; To catch this exception you need to import the zeep exception module.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;from zeep.exceptions import Fault&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; &amp;nbsp; Change your except step to:&lt;BR /&gt;&lt;STRONG&gt;except Fault as err:&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &lt;STRONG&gt;print(err)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Then you should get this output:&lt;BR /&gt;Item not valid: The specified line was not found&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 06:21:24 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-zeep-failing-to-trap-failure-on-getline-for-non-existent/m-p/4776495#M4035</guid>
      <dc:creator>BjoernMartin</dc:creator>
      <dc:date>2023-02-16T06:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python/Zeep - failing to trap failure on getLine for non-existent</title>
      <link>https://community.cisco.com/t5/management/python-zeep-failing-to-trap-failure-on-getline-for-non-existent/m-p/4776738#M4036</link>
      <description>&lt;P&gt;Excellent, thanks! I wish I had a better grasp of where to look for this sort of thing on my own. I swear I tried google and searching the community. It doesn't help that I'll have some tasks that I need to do where Python is the perfect tool, and then I might not touch it for months. Thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 12:17:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/management/python-zeep-failing-to-trap-failure-on-getline-for-non-existent/m-p/4776738#M4036</guid>
      <dc:creator>Elliot Dierksen</dc:creator>
      <dc:date>2023-02-16T12:17:02Z</dc:date>
    </item>
  </channel>
</rss>

