mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-30 19:36:24 +02:00
fixbug: DebugError
This commit is contained in:
parent
10d9f33150
commit
75dcc8d534
6 changed files with 107 additions and 43 deletions
|
|
@ -304,7 +304,13 @@ def print_members(module, indent=0):
|
|||
def parse_recipient(text):
|
||||
pattern = r"## Send To:\s*([A-Za-z]+)\s*?" # hard code for now
|
||||
recipient = re.search(pattern, text)
|
||||
return recipient.group(1) if recipient else ""
|
||||
if recipient:
|
||||
return recipient.group(1)
|
||||
pattern = r"Send To:\s*([A-Za-z]+)\s*?"
|
||||
recipient = re.search(pattern, text)
|
||||
if recipient:
|
||||
return recipient.group(1)
|
||||
return ""
|
||||
|
||||
|
||||
def get_class_name(cls) -> str:
|
||||
|
|
|
|||
|
|
@ -96,8 +96,15 @@ class FileRepository:
|
|||
path_name = self.workdir / filename
|
||||
if not path_name.exists():
|
||||
return None
|
||||
async with aiofiles.open(str(path_name), mode="r") as reader:
|
||||
doc.content = await reader.read()
|
||||
try:
|
||||
async with aiofiles.open(str(path_name), mode="r") as reader:
|
||||
doc.content = await reader.read()
|
||||
except FileNotFoundError as e:
|
||||
logger.info(f"open {str(path_name)} failed:{e}")
|
||||
return None
|
||||
except Exception as e:
|
||||
logger.info(f"open {str(path_name)} failed:{e}")
|
||||
return None
|
||||
return doc
|
||||
|
||||
async def get_all(self) -> List[Document]:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue