<?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: How Handle Genie Exceptions in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/how-handle-genie-exceptions/m-p/4396331#M2241</link>
    <description>&lt;P&gt;Nevermind that, I realized I had an error somewhere else when I tried to do "except Exception as e"&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;except Exception as e:
            if 'Parser Output is empty' in str(e):
                print(e)
            else:
                print('FATAL ERROR:')
                print(e)
                sys.exit()&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;seems to do the trick&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 30 Apr 2021 21:27:34 GMT</pubDate>
    <dc:creator>AJ Cruz</dc:creator>
    <dc:date>2021-04-30T21:27:34Z</dc:date>
    <item>
      <title>How Handle Genie Exceptions</title>
      <link>https://community.cisco.com/t5/controllers/how-handle-genie-exceptions/m-p/4396273#M2240</link>
      <description>&lt;P&gt;New to pyATS &amp;amp; Genie and kinda new to Python, I feel like I'm missing something very basic here but I can't figure out how to handle exceptions with Genie.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm dumping the mac table for specific vlans, but when I dump the table for a vlan with no mac entries my script throws this exception:&lt;/P&gt;&lt;PRE&gt;genie.metaparser.util.exceptions.SchemaEmptyParserError: Parser Output is empty&lt;/PRE&gt;&lt;P&gt;I can't figure out how to ignore this error and continue the script.&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;PRE&gt;try:
  &amp;lt;code&amp;gt;
except SchemaEmptyParserError as e:
  &amp;lt;handler&amp;gt;&lt;/PRE&gt;&lt;P&gt;as well as the full&amp;nbsp;genie.metaparser.util.exceptions.SchemaEmptyParserError&lt;/P&gt;&lt;P&gt;But neither works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 18:29:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/how-handle-genie-exceptions/m-p/4396273#M2240</guid>
      <dc:creator>AJ Cruz</dc:creator>
      <dc:date>2021-04-30T18:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: How Handle Genie Exceptions</title>
      <link>https://community.cisco.com/t5/controllers/how-handle-genie-exceptions/m-p/4396331#M2241</link>
      <description>&lt;P&gt;Nevermind that, I realized I had an error somewhere else when I tried to do "except Exception as e"&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;except Exception as e:
            if 'Parser Output is empty' in str(e):
                print(e)
            else:
                print('FATAL ERROR:')
                print(e)
                sys.exit()&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;seems to do the trick&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Apr 2021 21:27:34 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/how-handle-genie-exceptions/m-p/4396331#M2241</guid>
      <dc:creator>AJ Cruz</dc:creator>
      <dc:date>2021-04-30T21:27:34Z</dc:date>
    </item>
  </channel>
</rss>

