From f323bc4d8a49c4793b936f4e82615fcbb3baf3e1 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Wed, 8 Nov 2023 16:08:50 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(store.py):=20handle=20except?= =?UTF-8?q?ion=20when=20counting=20components=20to=20prevent=20potential?= =?UTF-8?q?=20errors=20and=20set=20comp=5Fcount=20to=200=20in=20case=20of?= =?UTF-8?q?=20exception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/langflow/api/v1/store.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/backend/langflow/api/v1/store.py b/src/backend/langflow/api/v1/store.py index 38acafdb7..9b5ba2809 100644 --- a/src/backend/langflow/api/v1/store.py +++ b/src/backend/langflow/api/v1/store.py @@ -104,12 +104,14 @@ def get_components( tags=tags, sort=sort, ) - - comp_count = store_service.count_components( - api_key=store_api_Key, - filter_by_user=filter_by_user, - is_component=is_component, - ) + try: + comp_count = store_service.count_components( + api_key=store_api_Key, + filter_by_user=filter_by_user, + is_component=is_component, + ) + except Exception: + comp_count = 0 if store_api_Key: # Now, from the result, we need to get the components