If an error occurs while retrieving object_info, only the node that encountered the error should be handled as an exception, while the information for the other nodes should continue to be processed normally.

This commit is contained in:
Dr.Lt.Data 2023-10-03 18:30:38 +09:00
parent ec454c771b
commit 1f38de1fb3
1 changed files with 5 additions and 1 deletions

View File

@ -413,7 +413,11 @@ class PromptServer():
async def get_object_info(request): async def get_object_info(request):
out = {} out = {}
for x in nodes.NODE_CLASS_MAPPINGS: for x in nodes.NODE_CLASS_MAPPINGS:
out[x] = node_info(x) try:
out[x] = node_info(x)
except Exception as e:
print(f"[ERROR] An error occurred while retrieving information for the '{x}' node.", file=sys.stderr)
traceback.print_exc()
return web.json_response(out) return web.json_response(out)
@routes.get("/object_info/{node_class}") @routes.get("/object_info/{node_class}")