Skip to content

Commit

Permalink
[issue1151] Improve error message when passing a heuristic to --search.
Browse files Browse the repository at this point in the history
Previously, the planner crashed with a bad anycast in cases where the
argument of `--search` could be parsed but had the wrong type, e.g.
`--search "lmcut()"`.
  • Loading branch information
FlorianPommerening authored Oct 7, 2024
1 parent 5d1bd6a commit 45e1e6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/search/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ static shared_ptr<SearchAlgorithm> parse_cmd_line_aux(const vector<string> &args
parser::DecoratedASTNodePtr decorated = parsed->decorate();
plugins::Any constructed = decorated->construct();
search_algorithm = plugins::any_cast<SearchPtr>(constructed);
} catch (const plugins::BadAnyCast &) {
input_error("Could not interpret the argument of --search as a search algorithm.");
} catch (const utils::ContextError &e) {
input_error(e.get_message());
}
Expand Down

0 comments on commit 45e1e6f

Please sign in to comment.