Better exception handling

This commit is contained in:
2Shirt 2018-07-26 18:29:14 -06:00
parent 127c3b810d
commit a19ac4772b
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -38,12 +38,21 @@ if __name__ == '__main__':
if not re.search(r'(^$|help|-h|\?)', run_mode, re.IGNORECASE):
print_error('Invalid mode.')
show_usage(script_name)
exit_script()
# Done
print_standard('\nDone.')
pause("Press Enter to exit...")
exit_script()
except GenericAbort as ga:
if str(ga):
print_warning(str(ga))
abort()
except GenericError as ge:
if str(ge):
print_error(str(ge))
else:
print_error('Generic Error?')
abort()
except SystemExit:
pass
except: