[CLEANUP ERROR]

pull/633/merge
Your Name 2 months ago
parent 1f47866722
commit f34010f204

@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry] [tool.poetry]
name = "swarms" name = "swarms"
version = "6.1.0" version = "6.1.1"
description = "Swarms - Pytorch" description = "Swarms - Pytorch"
license = "MIT" license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"] authors = ["Kye Gomez <kye@apac.ai>"]

@ -228,7 +228,7 @@ class AgentRegistry:
logger.info("Listing all agents.") logger.info("Listing all agents.")
return agent_names return agent_names
except Exception as e: except Exception as e:
report_error(e) logger.error(f"Error: {e}")
raise e raise e
def return_all_agents(self) -> List[Agent]: def return_all_agents(self) -> List[Agent]:
@ -244,7 +244,7 @@ class AgentRegistry:
logger.info("Returning all agents.") logger.info("Returning all agents.")
return agents return agents
except Exception as e: except Exception as e:
report_error(e) logger.error(f"Error: {e}")
raise e raise e
def query( def query(
@ -275,7 +275,7 @@ class AgentRegistry:
logger.info("Querying agents with condition.") logger.info("Querying agents with condition.")
return agents return agents
except Exception as e: except Exception as e:
report_error(e) logger.error(f"Error: {e}")
raise e raise e
def find_agent_by_name(self, agent_name: str) -> Optional[Agent]: def find_agent_by_name(self, agent_name: str) -> Optional[Agent]:
@ -299,7 +299,7 @@ class AgentRegistry:
if agent.agent_name == agent_name: if agent.agent_name == agent_name:
return agent return agent
except Exception as e: except Exception as e:
report_error(e) logger.error(f"Error: {e}")
raise e raise e
def agent_to_py_model(self, agent: Agent): def agent_to_py_model(self, agent: Agent):

@ -2,7 +2,9 @@ from functools import wraps
from time import time from time import time
from typing import Any, Callable 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( def retry(
@ -113,12 +115,12 @@ def try_except_wrapper(verbose: bool = False):
return result return result
except Exception as error: except Exception as error:
if verbose: if verbose:
report_error( logger.error(
f"An error occurred in function {func.__name__}:" f"An error occurred in function {func.__name__}:"
f" {error}" f" {error}"
) )
else: else:
report_error( logger.error(
f"An error occurred in function {func.__name__}:" f"An error occurred in function {func.__name__}:"
f" {error}" f" {error}"
) )

Loading…
Cancel
Save