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

Give more useful exception when an unrecognized tally scores is provided #1365

Open
gridley opened this issue Sep 24, 2019 · 2 comments

Comments

@gridley
Copy link
Contributor

commented Sep 24, 2019

Greetings,

Does anyone else think that a more helpful error message would be in order when someone gives a bad tally score type? Currently the error message is:

terminate called after throwing an instance of 'std::invalid_argument'
what(): Invalid tally score "banana"
Aborted (core dumped)

It would be quite helpful if the list of available score types were printed when this error happens. OpenFOAM does this automatically for any input which is restricted to a fixed list of strings.

@paulromano

This comment has been minimized.

Copy link
Contributor

commented Sep 30, 2019

The list of tally scores is pretty big, so I don't think we'd want to dump a huge wall of text on the user. I think that the error message is informative as is, although I suppose we could point them to the user's guide for a list of valid scores.

@gridley

This comment has been minimized.

Copy link
Contributor Author

commented Sep 30, 2019

Hm, OK, well, if you actually want a change to be made to the code, I'm happy to do this. Otherwise, agree that it's fine to not dump the options; I had not looked at that page of the docs and had no clue there was such an extensive list of options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.