diff --git a/poet/src/Engine.cpp b/poet/src/Engine.cpp index 8eead3b0..7c81b3c3 100644 --- a/poet/src/Engine.cpp +++ b/poet/src/Engine.cpp @@ -130,6 +130,12 @@ void PhreeqcEngine::Impl::run(double time_step) { const std::string runs_string = "RUN_CELLS\n -cells 1\n -time_step " + time_ss.str() + "\nEND\n"; this->RunString(runs_string.c_str()); + + if (this->GetErrorStringLineCount() > 0) { + std::cerr << ":: Error in Phreeqc script: " << this->GetErrorString() + << "\n"; + throw std::runtime_error("Phreeqc script error"); + } } void PhreeqcEngine::Impl::init_wrappers(const InitCell &cell) { @@ -242,4 +248,4 @@ void PhreeqcEngine::Impl::set_essential_values(const std::span &data) { data.subspan(offset, this->surfaceWrapperPtr->size())}; this->surfaceWrapperPtr->set(surf_span); } -} \ No newline at end of file +}