Include the offending path in the property-name parse exception#1474
Conversation
The property-name parser throws when a name contains a disallowed character but does not indicate which property path triggered it. Append the path to the exception message so the offending property can be identified.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1474 +/- ##
=======================================
Coverage 25.10% 25.10%
=======================================
Files 171 171
Lines 18843 18843
=======================================
Hits 4731 4731
Misses 14112 14112 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
So it looks like elsewhere in the same function some identifying information is included as part of the exception of the message. Any reason for not being consistent in terms of how the string is built for the exception message? jsbsim/src/simgear/props/props.cxx Line 191 in 0d44e12 What about this case lower down in the same function, should we not also include the path name in the exception to help users figure out which path name is problematic? jsbsim/src/simgear/props/props.cxx Line 215 in 0d44e12 |
|
I agree with @seanmcleod70 that all the |
|
I also agree with you both so I'll make the fixes. |
…exceptions All throw sites in the active parser now append the offending path so a malformed property path can be identified from the exception message. This covers the three exceptions in parse_name and the neighbouring unterminated-index exception in parse_index. Each message is built the same way, inside the string constructor, and the path is quoted so it stays legible when it contains a space or a colon. The change is confined to the parser compiled in this configuration (PROPS_STANDALONE); the template parser in the #else branch is left unchanged.
dc99ac9 to
0ba9674
Compare
|
I have made all the exceptions in the active parser consistent:
The change is confined to the parser compiled here (PROPS_STANDALONE). |
…exceptions All throw sites in the active parser now append the offending path so a malformed property path can be identified from the exception message. This covers the three exceptions in parse_name and the neighbouring unterminated-index exception in parse_index. Each message is built the same way, inside the string constructor, and the path is quoted so it stays legible when it contains a space or a colon. The change is confined to the parser compiled in this configuration (PROPS_STANDALONE); the template parser in the #else branch is left unchanged.
0ba9674 to
e9ddf8f
Compare
The property-name parser throws when a name contains a disallowed character but does not indicate which property path triggered it. Append the path to the exception message so the offending property can be identified.