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

Some parser related errors are silently ignored #21859

Closed
dschwen opened this issue Aug 16, 2022 · 2 comments · Fixed by #21862
Closed

Some parser related errors are silently ignored #21859

dschwen opened this issue Aug 16, 2022 · 2 comments · Fixed by #21862
Labels
T: task An enhancement to the software.

Comments

@dschwen
Copy link
Member

dschwen commented Aug 16, 2022

Reason

Parse tree post-processing by walker classes like the brace expander collect error messages in a vector but rely on the calling class to check for those messages and act. Otherwise the failure will be silent, and (in the case if the brace expander) no substitution will be made.

Design

Make sure all collected errors are checked and emitted as mooseErrors.

Impact

More useful errors for invalid input files.

@dschwen dschwen added the T: task An enhancement to the software. label Aug 16, 2022
@dschwen
Copy link
Member Author

dschwen commented Aug 16, 2022

MOOSE only example:

b = ${c}
a = 0.06 # Diameter of the pebbles (m).

[Mesh]
  type = SpiralAnnularMesh
  outer_radius = ${a}
[]

returns

*** ERROR ***
Range check failed for parameter Mesh/outer_radius
	Expression: outer_radius>0.
	Value: 0

despite outer_radius being set to 0.06. The Parser gets the raw string "${a}" instead, which converts to Real(0.0).

The expected error would be that ${c} cannot be resolved as c is never defined.

@dschwen
Copy link
Member Author

dschwen commented Aug 16, 2022

Prerequisite for this failure seems to be a _required range checked parameter(hereouter_radius`).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: task An enhancement to the software.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant