docs: exception handling guide for node API#1440
Open
leno23 wants to merge 1 commit into
Open
Conversation
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
Owner
|
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.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
docs/Error-Handling.mddocumenting when yaml-cpp throws public exceptions (ParserException,BadFile,TypedBadConversion,InvalidNode, etc.) and clarifies that missing map keys do not throwKeyNotFound— useif (node["key"])instead (addresses confusion in #1122).Links from README and Tutorial.
Fixes #1395
Refs #594, #1122
Test plan
Made with Cursor