refactor exception handling

This commit is contained in:
Lincoln Stein 2023-06-07 07:35:34 -04:00
parent d114833a12
commit a3357e073c

View File

@ -856,10 +856,7 @@ def select_and_download_models(opt: Namespace):
installApp = AddModelApplication(opt)
try:
installApp.run()
except Exception as e:
print(f'An exception has occurred: {str(e)}')
input('Press any key to continue...')
if hasattr(installApp,'main_form'):
except KeyboardInterrupt:
form = installApp.main_form
if form.subprocess and form.subprocess.is_alive():
logger.info('Terminating subprocesses')
@ -972,6 +969,9 @@ def main():
logger.error(
"Insufficient horizontal space for the interface. Please make your window wider and try again."
)
except Exception as e:
print(f'An exception has occurred: {str(e)}')
input('Press any key to continue...')
# -------------------------------------