Skip to content

feat(yaml): introduce YamlSyntaxError with structured position info#7235

Open
tomas-zijdemans wants to merge 2 commits into
denoland:mainfrom
tomas-zijdemans:yml-error
Open

feat(yaml): introduce YamlSyntaxError with structured position info#7235
tomas-zijdemans wants to merge 2 commits into
denoland:mainfrom
tomas-zijdemans:yml-error

Conversation

@tomas-zijdemans

Copy link
Copy Markdown
Contributor

Introducing YamlSyntaxError mirroring XmlSyntaxError from @std/xml:

  • YamlSyntaxError extends SyntaxError with line, column, offset, snippet
  • parse() and parseAll() now throw it (including the multi-document case, with position pointing at the second ---)
  • onWarning callback type tightened to YamlSyntaxError
  • error.message format unchanged. Fully backward-compatible

Note

Recreates #7156, which was closed automatically when I accidentally deleted the head fork. The branch is identical to the original PR head.

@github-actions github-actions Bot added the yaml label Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant