yaml-cpp icon indicating copy to clipboard operation
yaml-cpp copied to clipboard

Add more hits to the error "Error msg: bad conversion"

Open MMarcus95 opened this issue 1 year ago • 3 comments

Hello,

when I try to parse an empty yaml file I got the error "Error msg: bad conversion".

Could this error message be improved a bit?

For example, if I try to get a key that is not in the yaml file, the error message could say that the key is not in the file. Also, specifying that the error comes from yaml-cpp (e.g "Error msg: bad conversion when parsing <file_name>.yaml") can be very helpful because you can easily understand from where the issue comes from. In particular when using yaml-cpp inside a big software architecture.

Thanks!

MMarcus95 avatar Mar 14 '24 10:03 MMarcus95

same requirement.

cxwx avatar May 16 '24 11:05 cxwx

same

zhangyi1357 avatar Oct 18 '24 12:10 zhangyi1357

It should really throw an InvalidNode exception, and name the missing key. And a linenumber would also be really helpful. (for both exceptions).

yaml-cpp is not known for its speed (use rapidjson instead), but at least improve the error messages then.

rurban avatar Nov 01 '24 10:11 rurban