certik / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

Store string number where node is defined #255

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Product number: YAML-CPP 0.5.1, GCC 4.8.1

1. I've implemented YAML::convert< my_own_structure >::decode(...). First step 
is structure validation, next is parsing.
2. During validation I'm using { return false; } if YAML structure is 
unaccepted for me. This stops parsing and YAML-CPP generated error message is 
returned. This error message does not contain any information about place of 
error.
It's very difficult to find mistake in large YAML structure.

I believe the best way for error-reporting is to print call stack and line 
number where { return false; } happens first.
For example:
"Invalid node 'my_task'.'options'.'datetime'.'date' at line 86"
But implementation of such feature may spend a lot of time.

To my opinion the simplest way is to print line where invalid node placed and 
allow user (me) to get this line number.

Original issue reported on code.google.com by Dmitry.S...@gmail.com on 15 Aug 2014 at 4:23

GoogleCodeExporter commented 9 years ago
Yeah, this is a good idea. I think there's a related issue somewhere.

Original comment by jbe...@gmail.com on 22 Aug 2014 at 3:53

GoogleCodeExporter commented 9 years ago

Original comment by jbe...@gmail.com on 22 Aug 2014 at 3:54