Skip to content

Error location (v0.4.1) #232

Answered by biojppm
Beliar83 asked this question in Q&A
Mar 18, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

It depends on the phase:

  • When an error occurs while ryml is parsing the YAML code (ie, a legit YAML syntax error), the callback does receive the location on the YAML file (if you use the proper ryml::parse() overload).
  • Thereafter, when the error occurs from code you wrote to go through the data (ie, YAML is syntactically correct but the data is semantically wrong, or the c++ code does not match the data), then of course the failure cannot be implicitly traced to the YAML source. So you receive the C++ location where the error was detected.
  • But you can still get the YAML location using the locations feature to find where in the source a given node was. But there are some caveats. See the …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@biojppm
Comment options

@Beliar83
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by biojppm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants