Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions include/CLI/App.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2252,27 +2252,24 @@ class App {

/// Process callbacks and such.
void _process() {
CLI::FileError fe("ne");
bool caught_error{false};
try {
// the config file might generate a FileError but that should not be processed until later in the process
// to allow for help, version and other errors to generate first.
_process_config_file();

// process env shouldn't throw but no reason to process it if config generated an error
_process_env();
} catch(const CLI::FileError &fe2) {
fe = fe2;
caught_error = true;
} catch(const CLI::FileError &) {
// callbacks and help_flags can generate exceptions which should take priority
// over the config file error if one exists.
_process_callbacks();
_process_help_flags();
throw;
}
// callbacks and help_flags can generate exceptions which should take priority over the config file error if one
// exists

_process_callbacks();
_process_help_flags();

if(caught_error) {
throw CLI::FileError(std::move(fe));
}

_process_requirements();
}

Expand Down