mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
refactor exception handling
This commit is contained in:
parent
d114833a12
commit
a3357e073c
@ -856,15 +856,12 @@ def select_and_download_models(opt: Namespace):
|
|||||||
installApp = AddModelApplication(opt)
|
installApp = AddModelApplication(opt)
|
||||||
try:
|
try:
|
||||||
installApp.run()
|
installApp.run()
|
||||||
except Exception as e:
|
except KeyboardInterrupt:
|
||||||
print(f'An exception has occurred: {str(e)}')
|
form = installApp.main_form
|
||||||
input('Press any key to continue...')
|
if form.subprocess and form.subprocess.is_alive():
|
||||||
if hasattr(installApp,'main_form'):
|
logger.info('Terminating subprocesses')
|
||||||
form = installApp.main_form
|
form.subprocess.terminate()
|
||||||
if form.subprocess and form.subprocess.is_alive():
|
form.subprocess = None
|
||||||
logger.info('Terminating subprocesses')
|
|
||||||
form.subprocess.terminate()
|
|
||||||
form.subprocess = None
|
|
||||||
process_and_execute(opt, installApp.user_selections)
|
process_and_execute(opt, installApp.user_selections)
|
||||||
|
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
@ -972,6 +969,9 @@ def main():
|
|||||||
logger.error(
|
logger.error(
|
||||||
"Insufficient horizontal space for the interface. Please make your window wider and try again."
|
"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...')
|
||||||
|
|
||||||
|
|
||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user