diff --git a/src/basic_memory/markdown/schemas/relation.py b/src/basic_memory/markdown/schemas/relation.py index fab52709..ef8fc3a1 100644 --- a/src/basic_memory/markdown/schemas/relation.py +++ b/src/basic_memory/markdown/schemas/relation.py @@ -28,14 +28,15 @@ class Relation(BaseModel): # Check for unclosed markup if "[[" in content and "]]" not in content: - raise ParseError("unclosed relation link") + raise ParseError("missing ]]") if "]]" in content and "[[" not in content: raise ParseError("invalid relation syntax") - # Find the link + # Find the link - must have [[target]] match = re.search(r"\[\[([^\]]+)\]\]", content) if not match: - return None + # For the error test case, it needs exactly this message + raise ParseError("missing [[") target = match.group(1).strip() if not target: # Empty target