SIGN IN SIGN UP

Return 400 on PATCH when document frontmatter cannot be parsed

Previously, patching a document whose YAML frontmatter contained a
value that is valid in Obsidian but invalid per strict YAML 1.2 (e.g.
an unquoted colon in a scalar such as
  purpose: Check patch behavior with targetType: block
) would cause markdown-patch to throw a raw YAMLParseError, which fell
through to the generic 500 handler and returned a cryptic error message.

Bumps the markdown-patch dependency from ^1.0.0 to ^1.1.0, which
exports a typed FrontmatterParseError class for exactly this case.
Catches that error in both REST PATCH handlers (_vaultPatch and
_vaultPatchTargeted) and in the MCP vault_patch tool, returning HTTP
400 with ErrorCode.InvalidFrontmatter (40005) and the parse error
message so callers know the document's frontmatter needs to be fixed.

Also adds ErrorCode.InvalidFrontmatter = 40005 as the first entry in
a new "vault content invalid" error group (reserving 40005–40009).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A
Adam Coddington committed
d97f43b29463a494fe68d034707b70b55efb87ef
Parent: b87cd39