From 5bd2cae3998b7cf96267579255b9dceb0e59986e Mon Sep 17 00:00:00 2001 From: Scott R Charlton Date: Tue, 5 Aug 2014 02:42:09 +0000 Subject: [PATCH] made catch(...) always rethrow; changed catches to const references git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8905 1feff8c3-07ed-0310-ac33-dd36852eb9cd --- src/CSelectedOutput.cpp | 1 + src/IPhreeqc.cpp | 6 ++++++ src/IPhreeqcLib.cpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/CSelectedOutput.cpp b/src/CSelectedOutput.cpp index e279ab53..5298f1cb 100644 --- a/src/CSelectedOutput.cpp +++ b/src/CSelectedOutput.cpp @@ -168,6 +168,7 @@ int CSelectedOutput::PushBack(const char* key, const CVar& var) catch(...) { ASSERT(false); + throw; } return 1; // error } diff --git a/src/IPhreeqc.cpp b/src/IPhreeqc.cpp index 88a85ab4..4c8565cd 100644 --- a/src/IPhreeqc.cpp +++ b/src/IPhreeqc.cpp @@ -112,6 +112,7 @@ VRESULT IPhreeqc::AccumulateLine(const char *line) catch (...) { this->AddError("AccumulateLine: An unhandled exception occured.\n"); + throw; } return VR_OUTOFMEMORY; } @@ -600,6 +601,7 @@ int IPhreeqc::load_db(const char* filename) { // do nothing } + throw; } this->PhreeqcPtr->phrq_io->clear_istream(); this->DatabaseLoaded = (this->PhreeqcPtr->get_input_errors() == 0); @@ -662,6 +664,7 @@ int IPhreeqc::load_db_str(const char* input) { // do nothing } + throw; } this->PhreeqcPtr->phrq_io->clear_istream(); @@ -750,6 +753,7 @@ int IPhreeqc::RunAccumulated(void) { // do nothing } + throw; } this->ClearAccumulated = true; @@ -806,6 +810,7 @@ int IPhreeqc::RunFile(const char* filename) { // do nothing } + throw; } this->close_output_files(); @@ -854,6 +859,7 @@ int IPhreeqc::RunString(const char* input) { // do nothing } + throw; } this->close_output_files(); diff --git a/src/IPhreeqcLib.cpp b/src/IPhreeqcLib.cpp index cae2efb8..b61440ff 100644 --- a/src/IPhreeqcLib.cpp +++ b/src/IPhreeqcLib.cpp @@ -1003,7 +1003,7 @@ IPhreeqcLib::CreateIPhreeqc(void) IPhreeqcPtr = new IPhreeqc; n = (int) IPhreeqcPtr->Index; } - catch(...) + catch (const std::bad_alloc&) { return IPQ_OUTOFMEMORY; }