diff options
author | Aarni Koskela <akx@iki.fi> | 2023-05-29 05:54:13 +0000 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2023-05-29 06:17:30 +0000 |
commit | 00dfe27f59727407c5b408a80ff2a262934df495 (patch) | |
tree | aae9d324a719c7e500f4a0c45821851bc6e41ee0 /modules/config_states.py | |
parent | b957dcfece29c84ac0cfcd5a69475ff8684c531f (diff) | |
download | stable-diffusion-webui-gfx803-00dfe27f59727407c5b408a80ff2a262934df495.tar.gz stable-diffusion-webui-gfx803-00dfe27f59727407c5b408a80ff2a262934df495.tar.bz2 stable-diffusion-webui-gfx803-00dfe27f59727407c5b408a80ff2a262934df495.zip |
Add & use modules.errors.print_error where currently printing exception info by hand
Diffstat (limited to 'modules/config_states.py')
-rw-r--r-- | modules/config_states.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/modules/config_states.py b/modules/config_states.py index db65bcdb..faeaf28b 100644 --- a/modules/config_states.py +++ b/modules/config_states.py @@ -3,8 +3,6 @@ Supports saving and restoring webui and extensions from a known working set of c """ import os -import sys -import traceback import json import time import tqdm @@ -14,6 +12,7 @@ from collections import OrderedDict import git from modules import shared, extensions +from modules.errors import print_error from modules.paths_internal import script_path, config_states_dir @@ -53,8 +52,7 @@ def get_webui_config(): if os.path.exists(os.path.join(script_path, ".git")): webui_repo = git.Repo(script_path) except Exception: - print(f"Error reading webui git info from {script_path}:", file=sys.stderr) - print(traceback.format_exc(), file=sys.stderr) + print_error(f"Error reading webui git info from {script_path}", exc_info=True) webui_remote = None webui_commit_hash = None @@ -134,8 +132,7 @@ def restore_webui_config(config): if os.path.exists(os.path.join(script_path, ".git")): webui_repo = git.Repo(script_path) except Exception: - print(f"Error reading webui git info from {script_path}:", file=sys.stderr) - print(traceback.format_exc(), file=sys.stderr) + print_error(f"Error reading webui git info from {script_path}", exc_info=True) return try: @@ -143,8 +140,7 @@ def restore_webui_config(config): webui_repo.git.reset(webui_commit_hash, hard=True) print(f"* Restored webui to commit {webui_commit_hash}.") except Exception: - print(f"Error restoring webui to commit {webui_commit_hash}:", file=sys.stderr) - print(traceback.format_exc(), file=sys.stderr) + print_error(f"Error restoring webui to commit{webui_commit_hash}") def restore_extension_config(config): |