From 913b5f2fb1503d22274903a20e2470c484e9f548 Mon Sep 17 00:00:00 2001 From: Ram Rachum Date: Mon, 18 Dec 2023 16:41:33 +0200 Subject: [PATCH] Fix exception cause in agent_builder.py (#1007) --- autogen/agentchat/contrib/agent_builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogen/agentchat/contrib/agent_builder.py b/autogen/agentchat/contrib/agent_builder.py index 91386519dc1a..d16e04307c3c 100644 --- a/autogen/agentchat/contrib/agent_builder.py +++ b/autogen/agentchat/contrib/agent_builder.py @@ -446,7 +446,7 @@ def load( try: with open(filepath) as f: cached_configs = json.load(f) - except FileNotFoundError: - raise FileNotFoundError(f"{filepath} does not exist.") + except FileNotFoundError as e: + raise FileNotFoundError(f"{filepath} does not exist.") from e _config_check(cached_configs) return self.build(cached_configs=cached_configs, **kwargs)