04-30-2021 11:29 AM
New to pyATS & 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.
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:
genie.metaparser.util.exceptions.SchemaEmptyParserError: Parser Output is empty
I can't figure out how to ignore this error and continue the script.
I tried:
try: <code> except SchemaEmptyParserError as e: <handler>
as well as the full genie.metaparser.util.exceptions.SchemaEmptyParserError
But neither works.
Solved! Go to Solution.
04-30-2021 02:27 PM
Nevermind that, I realized I had an error somewhere else when I tried to do "except Exception as e"
except Exception as e: if 'Parser Output is empty' in str(e): print(e) else: print('FATAL ERROR:') print(e) sys.exit()
04-30-2021 02:27 PM
Nevermind that, I realized I had an error somewhere else when I tried to do "except Exception as e"
except Exception as e: if 'Parser Output is empty' in str(e): print(e) else: print('FATAL ERROR:') print(e) sys.exit()
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide