From 6067c324fb212686962ca7cf764631d55cd4d896 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 13 Nov 2023 14:54:05 -0300 Subject: [PATCH] Handle HTTPStatusError in get_components function --- src/backend/langflow/api/v1/store.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backend/langflow/api/v1/store.py b/src/backend/langflow/api/v1/store.py index 9dc5a27ae..6bbe00705 100644 --- a/src/backend/langflow/api/v1/store.py +++ b/src/backend/langflow/api/v1/store.py @@ -119,9 +119,11 @@ def get_components( ) else: comp_count = 0 - except Exception: - #! This should be removed once we fix the bug - comp_count = 0 + except HTTPStatusError as exc: + if exc.response.status_code == 403: + raise ValueError( + "You are not authorized to access this public resource" + ) if store_api_Key and result: # Now, from the result, we need to get the components