diff --git a/IPhreeqc.cpp b/IPhreeqc.cpp index 36a81b86..b98f7a7b 100644 --- a/IPhreeqc.cpp +++ b/IPhreeqc.cpp @@ -742,6 +742,20 @@ int IPhreeqc::RunAccumulated(void) { // do nothing } + catch(std::exception &e) + { + std::string errmsg("RunAccumulated: "); + errmsg += e.what(); + try + { + this->PhreeqcPtr->error_msg(errmsg.c_str(), STOP); // throws PhreeqcStop + } + catch (IPhreeqcStop) + { + // do nothing + } + throw; + } catch(...) { const char *errmsg = "RunAccumulated: An unhandled exception occured.\n"; @@ -799,6 +813,20 @@ int IPhreeqc::RunFile(const char* filename) { this->close_input_files(); } + catch(std::exception &e) + { + std::string errmsg("RunFile: "); + errmsg += e.what(); + try + { + this->PhreeqcPtr->error_msg(errmsg.c_str(), STOP); // throws PhreeqcStop + } + catch (IPhreeqcStop) + { + // do nothing + } + throw; + } catch(...) { const char *errmsg = "RunFile: An unhandled exception occured.\n";