Open mcandre opened 10 months ago
Thats what I meet either. I make a wrapper for the lower level API usages. Its not easy and costs lots of time. Maybe a more detailed error trace messages should be added by ryml.
I agree that the error messages could be improved. I am revisiting this in the context of #389 and I will devise a better solution.
Actually this fix missed the boat on #389.
I'm thinking of adding a second error handler for node visitation:
// existing error handler: tuned for parsing
using pfn_error = void (*) (const char* msg, size_t msg_len, Location location, void *user_data);
// to be added: tuned for visiting
using pfn_error_visit = void (*) (const char* msg, size_t msg_len, Tree const& tree, size_t id, void *user_data);
But this involves a thorough look at the existing calls, so it will have to wait for ongoing work to be merged in (specifically #414 which is giant).
rapidyaml often reports
check failed: (ch != NONE)
when attempting to traverse YAML data that omits expected keys.In large applications, most users will be confused by this message, unable to take action to correct the mistake.
Can we please present more specific error messages. For example, indicate the name of the YAML key that the application was attempting to lookup.