mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Changed OPM_THROW to return EXIT_FAILURE in flow_cp.cpp
This commit is contained in:
parent
9edbf38439
commit
fb99528673
@ -128,7 +128,8 @@ try
|
||||
parameter::ParameterGroup param(argc, argv, false);
|
||||
if (!param.unhandledArguments().empty()) {
|
||||
if (param.unhandledArguments().size() != 1) {
|
||||
OPM_THROW(std::runtime_error, "You can only specify a single input deck on the command line.");
|
||||
std::cerr << "You can only specify a single input deck on the command line.\n";
|
||||
return EXIT_FAILURE;
|
||||
} else {
|
||||
param.insertParameter("deck_filename", param.unhandledArguments()[0]);
|
||||
}
|
||||
@ -140,8 +141,8 @@ try
|
||||
"Specify the deck filename either\n"
|
||||
" a) as a command line argument by itself\n"
|
||||
" b) as a command line parameter with the syntax deck_filename=<path to your deck>, or\n"
|
||||
" c) as a parameter in a parameter file (.param or .xml) passed to the program.";
|
||||
OPM_THROW(std::runtime_error, "Input deck required.");
|
||||
" c) as a parameter in a parameter file (.param or .xml) passed to the program.\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
std::shared_ptr<Dune::CpGrid> grid;
|
||||
std::shared_ptr<BlackoilPropertiesInterface> props;
|
||||
@ -165,7 +166,8 @@ try
|
||||
create_directories(fpath);
|
||||
}
|
||||
catch (...) {
|
||||
OPM_THROW(std::runtime_error, "Creating directories failed: " << fpath);
|
||||
std::cerr << "Creating directories failed: " << fpath << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
// Write simulation parameters.
|
||||
param.writeParam(output_dir + "/simulation.param");
|
||||
@ -271,9 +273,10 @@ try
|
||||
{
|
||||
if( param.getDefault("output_matlab", false) || param.getDefault("output_ecl", true) )
|
||||
{
|
||||
OPM_THROW(std::logic_error, "We only support vtk output during parallel runs. "
|
||||
<<"Please use \"output_matlab=false output_ecl=false\" to deactivate the "
|
||||
<<"other outputs!");
|
||||
std::cerr << "We only support vtk output during parallel runs. \n"
|
||||
<< "Please use \"output_matlab=false output_ecl=false\" to deactivate the \n"
|
||||
<< "other outputs!" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
grid->loadBalance();
|
||||
Dune::CpGrid global_grid = *grid;
|
||||
@ -359,6 +362,6 @@ try
|
||||
}
|
||||
catch (const std::exception &e) {
|
||||
std::cerr << "Program threw an exception: " << e.what() << "\n";
|
||||
throw;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user