Skip to content

docs: exception handling guide for node API#1440

Open
leno23 wants to merge 1 commit into
jbeder:masterfrom
leno23:docs/1395-exception-handling
Open

docs: exception handling guide for node API#1440
leno23 wants to merge 1 commit into
jbeder:masterfrom
leno23:docs/1395-exception-handling

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 26, 2026

Summary

Adds docs/Error-Handling.md documenting when yaml-cpp throws public exceptions (ParserException, BadFile, TypedBadConversion, InvalidNode, etc.) and clarifies that missing map keys do not throw KeyNotFound — use if (node["key"]) instead (addresses confusion in #1122).

Links from README and Tutorial.

Fixes #1395
Refs #594, #1122

Test plan

  • Documentation only

Made with Cursor

Add Error-Handling.md covering ParserException, conversion errors,
optional map keys (operator[] does not throw KeyNotFound), and emitter
failures. Link from README and Tutorial.

Fixes jbeder#1395
Refs jbeder#594, jbeder#1122
@jbeder
Copy link
Copy Markdown
Owner

jbeder commented May 26, 2026

FYI, see our rules about AI usage: https://github.com/jbeder/yaml-cpp/blob/master/CONTRIBUTING.md#ai-usage

(I just wrote these up, but I've had these rules in my head for a while. It's possible this is OK, but I want to make sure you're aware of the rule and explanation. I haven't reviewed your doc yet, but I noticed it said "Made with Cursor", hence this message. Treat this comment for your other PRs as well.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Please enhance contect about excetpions handling in yaml-cpp

2 participants