Merge pull request #451 from Amorano/patch-1

report error instead of exception dump
This commit is contained in:
Weixuan Fu
2024-08-13 00:19:30 +08:00
committed by GitHub
+5 -1
View File
@@ -53,6 +53,10 @@ def folder_handle(path, recursive, metaInfoOnly, fileList=None):
def file_handle(name, fileList, file_path, metaInfoOnly):
with open(file_path, 'r', encoding='utf-8') as f:
json_data = json.load(f)
if not isinstance(json_data, (dict,)):
logging.error(f"{file_path} not in proper ComfyUI workflow format")
return
createTime, updateTime = getFileCreateTime(file_path)
workspace_info = json_data.get('extra', {}).get('workspace_info', {})
@@ -96,4 +100,4 @@ def getFileCreateTime(path):
createTime = int(getattr(file_stats, 'st_birthtime', file_stats.st_ctime) * 1000)
updateTime = int(file_stats.st_mtime * 1000)
return createTime, updateTime
return createTime, updateTime