-
Notifications
You must be signed in to change notification settings - Fork 89
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
[EPIC] Improve feedback to user on XML errors #2320
Comments
Can you put the actual error message close to the desired error message? |
1. Prevents crashing when PathCollection::objectPath is wrong (thus, solving the case 2.1 of the issue #2320) 2. Adds a context in case of a wrong PackCollection or FieldSpecification objectPath so we know from which object the error comes from (thus, solving the case 2.2 of the issue #2320). In order to output the name of the Group with a wrong objectPath, this PR propose to use the GEOSX_THROW macros and try-catch to add a context to the originally thrown exception (inserting a line starting with ***** ERROR:): ***** ERROR: initialPressure has a wrong objectPath. The following error have been thrown: ***** LOCATION: /appli_PITSI/MelvinRey/GEOSX_repos/GEOSX/src/coreComponents/mesh/MeshObjectPath.cpp:225 ***** Controlling expression (should be false): !foundMatch ***** Rank 0: elementRegionsGroup doesn't have a child named badRegion. elementRegionsGroup have the following children: reservoir, wellRegion 3. Fixes Group::getPath() so it no longer starts with m/ but with / (that m was the end of Problem which seemed wrongly cut). This fix will help a bit to output clearer path errors (this was the only use of getPath()). The returned path would be of the following form: /Tasks/myPackCollection (the leading / symbolizing it is an absolute path) A `testGroupPath` was added to validate: - the getPath() output, - the getGroupByPath() input, - if the Group hierarchy keeps being as we expect.
Hurray @MelReyCG , this is done. EDIT: what about case 4? |
I re-run the tests I made for this EPIC, and this point is not solved yet (the error is still the same). |
@MelReyCG is it done now? |
Typical XML user syntax, path and naming errors (additional commas or spaces, misplaced slash, missing fields) produce messages in the standard output which consistency and readibility by a user can be improved.
error improvement exemples.pdf
general presentation.pdf
GEOS PRs:
Controlling expression (should be false): inputStream.peek() != '}'
"wellPressureCollection": Empty entry in line "{ water, ,rock }". Please remove a comma or add an entry.
std::bad_alloc
/Segmentation fault
Group m/ElementRegion does not have a child wellRegion
Error in initialPressure objectPath : Group ElementRegions doesn't have a child named wellRegion123. ElementRegions have the following children: wellRegion1,wellRegion2,meshRegion1
Group m/domain/MeshBodies/cartesianMesh/meshLevels/Level0/ElementRegions/elementRegionsGroup/reservoir/elementSubRegions/cellBlock doesn't have a child pressures
CompositionalMultiphaseFVM::targetRegions
,materialList
,cellBlockNames
Group m/domain/MeshBodies/cartesianMesh/meshLevels/Level0/ElementRegions/elementRegionsGroup doesn't have a child -1
"reservoir" must have cellBlocks.
,
or/
) in a name fieldGroup m/Solvers/compositionalMultiphaseWell doesn't have a child wellControls
(the error happens when we reference the object which name ends with a space)"cartesianMesh " name field cannot contain forbidden characters.
,
or/
) in a name field referenceError detected while parsing string: "wellControls "
"wellInjector1" wellControlsName field must not contain forbidden characters.
,
or/
)->
Group m/domain/MeshBodies/cartesianMesh/meshLevels/Level0/ElementRegions/elementRegionsGroup/wellRegion/elementSubRegions doesn't have a child wellRegionUniqueSubRegion_
->
Error detected while parsing string: "ElementRegions/wellRegion/wellRegionUniqueSubRegion "
Group "wellPressureCollection" objectPath "wellRegionUniqueSubRegion_" cannot contain forbidden characters.
Side note
These suggested messages could change, they must be followed by the stacktrace, and their goal is to contain all needed information for a developper to debug and for a user to understand his mistake in his xml.
The text was updated successfully, but these errors were encountered: