From 147a2e4097d93f733f3e88454f684880b4c3a4a3 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Mon, 4 Dec 2023 19:17:49 -0300 Subject: [PATCH] Refactor store service module --- src/backend/langflow/services/store/service.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/backend/langflow/services/store/service.py b/src/backend/langflow/services/store/service.py index 94a89f974..52ee1c861 100644 --- a/src/backend/langflow/services/store/service.py +++ b/src/backend/langflow/services/store/service.py @@ -498,11 +498,13 @@ class StoreService(Service): comp_count = metadata.get("filter_count", 0) except HTTPStatusError as exc: if exc.response.status_code == 403: - raise ForbiddenError("You are not authorized to access this public resource") + raise ForbiddenError("You are not authorized to access this public resource") from exc elif exc.response.status_code == 401: - raise APIKeyError("You are not authorized to access this resource. Please check your API key.") + raise APIKeyError( + "You are not authorized to access this resource. Please check your API key." + ) from exc except Exception as exc: - raise ValueError(f"Unexpected error: {exc}") + raise ValueError(f"Unexpected error: {exc}") from exc try: if result and not metadata: if len(result) >= limit: