Skip to content

Commit

Permalink
Merge pull request #28515 from DanielYankura/fix_for_26714
Browse files Browse the repository at this point in the history
Improves error message for invalid dump parameter
  • Loading branch information
GiudGiud authored Sep 5, 2024
2 parents af0579a + 84b3c43 commit 9a6b276
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
18 changes: 12 additions & 6 deletions framework/src/base/MooseApp.C
Original file line number Diff line number Diff line change
Expand Up @@ -820,13 +820,19 @@ MooseApp::setupOptions()
_builder.buildJsonSyntaxTree(tree);
}

// Turn off live printing so that it doesn't mess with the dump
_perf_graph.disableLivePrint();
// Check if second arg is valid or not
if ((tree.getRoot()).is_object())
{
// Turn off live printing so that it doesn't mess with the dump
_perf_graph.disableLivePrint();

JsonInputFileFormatter formatter;
Moose::out << "\n### START DUMP DATA ###\n"
<< formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###" << std::endl;
_ready_to_exit = true;
JsonInputFileFormatter formatter;
Moose::out << "\n### START DUMP DATA ###\n"
<< formatter.toString(tree.getRoot()) << "\n### END DUMP DATA ###" << std::endl;
_ready_to_exit = true;
}
else
mooseError("Search parameter '", param_search, "' was not found in the registered syntax.");
}
else if (isParamValid("registry"))
{
Expand Down
9 changes: 9 additions & 0 deletions test/tests/misc/check_error/tests
Original file line number Diff line number Diff line change
Expand Up @@ -1169,4 +1169,13 @@
design = 'MooseUtils.md'
issues = '#17407'
[]
[dump_error_with_unrecogized_param]
type = 'RunException'
input = ''
cli_args = '--dump bad_parameter'
expect_err = "Search parameter 'bad_parameter' was not found in the registered syntax."

requirement = 'The system shall report a helpful error when the dump parameter does not match any valid parameters'
issues = '#26714'
[]
[]

0 comments on commit 9a6b276

Please sign in to comment.