mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-11-03 20:56:43 -06:00
Convert assert() to throw
Convert assert() to throw to be consistent with usage elsewhere in the code base where external interface violations should cause thrown exceptions instead of causing assertion failures which will not even be enforced in release builds.
This commit is contained in:
1 parent
f9cfbf0c68
commit
5be44f3802
1 file changed
+5
-1
@@ -311,7 +311,11 @@ namespace Opm
|
||||
if (!fixed_control) {
|
||||
// When solving_with_zero_rate=true, fixed_control=true, so this block should never
|
||||
// be entered.
|
||||
assert(!solving_with_zero_rate);
|
||||
if (solving_with_zero_rate) {
|
||||
OPM_DEFLOG_THROW(std::runtime_error, fmt::format(
|
||||
"Well {}: solving_with_zero_rate should not be true when fixed_control is false",
|
||||
this->name()), deferred_logger);
|
||||
}
|
||||
|
||||
// Changing to group controls here may lead to inconsistencies in the group handling which in turn
|
||||
// may result in excessive back and forth switching. However, we currently allow this by default.
|
||||
|
||||
Reference in new issue
Block a user