From f34010f20474cb182bcc3f60163604abff84bc7a Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 18 Nov 2024 15:45:48 -0800 Subject: [PATCH] [CLEANUP ERROR] --- pyproject.toml | 2 +- swarms/structs/agent_registry.py | 8 ++++---- swarms/utils/try_except_wrapper.py | 8 +++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7914360d..0e902b39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "6.1.0" +version = "6.1.1" description = "Swarms - Pytorch" license = "MIT" authors = ["Kye Gomez "] diff --git a/swarms/structs/agent_registry.py b/swarms/structs/agent_registry.py index 75a2a226..09348622 100644 --- a/swarms/structs/agent_registry.py +++ b/swarms/structs/agent_registry.py @@ -228,7 +228,7 @@ class AgentRegistry: logger.info("Listing all agents.") return agent_names except Exception as e: - report_error(e) + logger.error(f"Error: {e}") raise e def return_all_agents(self) -> List[Agent]: @@ -244,7 +244,7 @@ class AgentRegistry: logger.info("Returning all agents.") return agents except Exception as e: - report_error(e) + logger.error(f"Error: {e}") raise e def query( @@ -275,7 +275,7 @@ class AgentRegistry: logger.info("Querying agents with condition.") return agents except Exception as e: - report_error(e) + logger.error(f"Error: {e}") raise e def find_agent_by_name(self, agent_name: str) -> Optional[Agent]: @@ -299,7 +299,7 @@ class AgentRegistry: if agent.agent_name == agent_name: return agent except Exception as e: - report_error(e) + logger.error(f"Error: {e}") raise e def agent_to_py_model(self, agent: Agent): diff --git a/swarms/utils/try_except_wrapper.py b/swarms/utils/try_except_wrapper.py index 827fb9c3..faa63534 100644 --- a/swarms/utils/try_except_wrapper.py +++ b/swarms/utils/try_except_wrapper.py @@ -2,7 +2,9 @@ from functools import wraps from time import time from typing import Any, Callable -from swarms.utils.loguru_logger import logger +from swarms.utils.loguru_logger import initialize_logger + +logger = initialize_logger("try_except_wrapper") def retry( @@ -113,12 +115,12 @@ def try_except_wrapper(verbose: bool = False): return result except Exception as error: if verbose: - report_error( + logger.error( f"An error occurred in function {func.__name__}:" f" {error}" ) else: - report_error( + logger.error( f"An error occurred in function {func.__name__}:" f" {error}" )