Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MMarcus95 opened this issue Mar 14, 2024 · 3 comments
Open

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

MMarcus95 opened this issue Mar 14, 2024 · 3 comments

Comments

@MMarcus95
Copy link

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!

@cxwx
Copy link

cxwx commented May 16, 2024

same requirement.

@zhangyi1357
Copy link

same

@rurban
Copy link

rurban commented Nov 1, 2024

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 pushed a commit to SpexAI/yaml-cpp that referenced this issue Nov 1, 2024
rurban pushed a commit to SpexAI/yaml-cpp that referenced this issue Nov 1, 2024
jbeder pushed a commit that referenced this issue Nov 1, 2024
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

No branches or pull requests

4 participants