diff --git a/Code/Mantid/Framework/Algorithms/src/CorrectToFile.cpp b/Code/Mantid/Framework/Algorithms/src/CorrectToFile.cpp index 9c80708149f3b1813ba7f450dab01dcd6b7ec263..601531cbb6a1acb61f9b67431727f467eb722cb9 100644 --- a/Code/Mantid/Framework/Algorithms/src/CorrectToFile.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CorrectToFile.cpp @@ -201,7 +201,7 @@ void CorrectToFile::doWkspAlgebra(API::MatrixWorkspace_sptr lhs, API::MatrixWork { algebra->execute(); } - catch(std::runtime_error) + catch(std::runtime_error &) { g_log.warning() << "Error encountered while running algorithm " << algName << std::endl; g_log.error() << "Correction file " << getPropertyValue("Filename") + " can't be used to correct workspace " << getPropertyValue("WorkspaceToCorrect") << std::endl; diff --git a/Code/Mantid/Framework/Algorithms/src/CuboidGaugeVolumeAbsorption.cpp b/Code/Mantid/Framework/Algorithms/src/CuboidGaugeVolumeAbsorption.cpp index 9bdf3157132da6b93294a728c77a5d304ce4b0cd..fdfd4a13cec58721a53b3879fa377700c39e80d4 100644 --- a/Code/Mantid/Framework/Algorithms/src/CuboidGaugeVolumeAbsorption.cpp +++ b/Code/Mantid/Framework/Algorithms/src/CuboidGaugeVolumeAbsorption.cpp @@ -55,7 +55,7 @@ void CuboidGaugeVolumeAbsorption::initialiseCachedDistances() try { FlatPlateAbsorption::initialiseCachedDistances(); - } catch (Exception::InstrumentDefinitionError) { + } catch (Exception::InstrumentDefinitionError &) { // Create and throw a new exception with a more specific message throw Exception::InstrumentDefinitionError( "This algorithm requires that the sample fully encloses the requested gauge volume."); diff --git a/Code/Mantid/Framework/Algorithms/src/FilterEventsHighFrequency.cpp b/Code/Mantid/Framework/Algorithms/src/FilterEventsHighFrequency.cpp index bbfc7fcba3bff8a5070350b28f65806b4c9267d7..de45719bd3364e6c2a0ca654cfec0ef3e87d99e8 100644 --- a/Code/Mantid/Framework/Algorithms/src/FilterEventsHighFrequency.cpp +++ b/Code/Mantid/Framework/Algorithms/src/FilterEventsHighFrequency.cpp @@ -271,7 +271,7 @@ namespace Algorithms ifs.close(); - } catch (std::ifstream::failure e){ + } catch (std::ifstream::failure & e){ // b. Using faking offset/calibration g_log.error() << "Open calibration/offset file " << calfilename << " error " << std::endl; g_log.notice() << "Using fake detector offset/calibration" << std::endl; diff --git a/Code/Mantid/Framework/Algorithms/src/FlatBackground.cpp b/Code/Mantid/Framework/Algorithms/src/FlatBackground.cpp index 68e3b14aa7737053a92764c7bc60f5a9d872888a..096cdc886b99a5e15af07a0ccd59f329d34431cd 100644 --- a/Code/Mantid/Framework/Algorithms/src/FlatBackground.cpp +++ b/Code/Mantid/Framework/Algorithms/src/FlatBackground.cpp @@ -178,7 +178,7 @@ void FlatBackground::exec() } } } - catch (std::exception) + catch (std::exception &) { g_log.error() << "Error processing the spectrum with index " << currentSpec << std::endl; throw; diff --git a/Code/Mantid/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp b/Code/Mantid/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp index 21ffe483e5f4e8e7cf26f4395db5320a441e7ed8..7f375a32582c903c229931b79708412fcb888cb6 100644 --- a/Code/Mantid/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp +++ b/Code/Mantid/Framework/Algorithms/src/HRPDSlabCanAbsorption.cpp @@ -124,7 +124,7 @@ void HRPDSlabCanAbsorption::exec() try { det = workspace->getDetector(i); - } catch (Exception::NotFoundError) + } catch (Exception::NotFoundError &) { // Catch when a spectrum doesn't have an attached detector and go to next one continue; diff --git a/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp b/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp index edcea7d80e266bc1a523607e14c632465412ea25..dcb389a4751e8c27d74e42f95da684a21ee4e569 100644 --- a/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp +++ b/Code/Mantid/Framework/Algorithms/src/MedianDetectorTest.cpp @@ -203,7 +203,7 @@ namespace Mantid } } //catch all exceptions because the solid angle calculation is optional - catch(std::exception e) + catch(std::exception & e) { g_log.warning( "Precision warning: Can't find detector geometry " + name() + diff --git a/Code/Mantid/Framework/Algorithms/src/NormaliseToMonitor.cpp b/Code/Mantid/Framework/Algorithms/src/NormaliseToMonitor.cpp index af8e3c78b1ec60f05c46649d6c635e6c307b0297..7580a51d6460fe4dc96eedb72d8f716310230bc6 100644 --- a/Code/Mantid/Framework/Algorithms/src/NormaliseToMonitor.cpp +++ b/Code/Mantid/Framework/Algorithms/src/NormaliseToMonitor.cpp @@ -260,7 +260,7 @@ void NormaliseToMonitor::checkProperties(API::MatrixWorkspace_sptr inputWorkspac g_log.warning("The spectrum in MonitorWorkspace does not refer to a monitor.\n" "Continuing with normalisation regardless."); } - } catch (Kernel::Exception::NotFoundError) { + } catch (Kernel::Exception::NotFoundError &) { g_log.warning("Unable to check if the spectrum provided relates to a monitor - " "the instrument is not fully specified.\n" "Continuing with normalisation regardless."); diff --git a/Code/Mantid/Framework/Algorithms/src/Regroup.cpp b/Code/Mantid/Framework/Algorithms/src/Regroup.cpp index 3c34c1200af8fe9d85f9ac4af0d4da21603d6d81..adfb629a743e9ca4e7cd8b68b0932a6566369cd5 100644 --- a/Code/Mantid/Framework/Algorithms/src/Regroup.cpp +++ b/Code/Mantid/Framework/Algorithms/src/Regroup.cpp @@ -131,7 +131,7 @@ void Regroup::exec() if (inputW->getAxis(1)->unit().get()) outputW->getAxis(1)->unit() = inputW->getAxis(1)->unit(); } - catch(Exception::IndexError) { + catch(Exception::IndexError &) { // OK, so this isn't a Workspace2D } diff --git a/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp b/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp index 753bde0f609837103ea035619f8e366e8cece39e..e4071a111cbb5aaefe327a724249c35b20f080f2 100644 --- a/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp +++ b/Code/Mantid/Framework/Algorithms/src/UnwrapSNS.cpp @@ -309,7 +309,7 @@ double UnwrapSNS::calculateFlightpath(const int& spectrum, bool& isMonitor) cons Ld = det->getDistance(*(m_inputWS->getInstrument()->getSource())); } } - catch (Exception::NotFoundError) + catch (Exception::NotFoundError &) { // If the detector information is missing, return a negative number } diff --git a/Code/Mantid/Framework/Algorithms/test/AlphaCalcTest.h b/Code/Mantid/Framework/Algorithms/test/AlphaCalcTest.h index 28f8404a74fa308a3f885386bd2f67f8c7a7ec56..80b2f9d2ac0df5ee12e89af966af60fd5e3241d0 100644 --- a/Code/Mantid/Framework/Algorithms/test/AlphaCalcTest.h +++ b/Code/Mantid/Framework/Algorithms/test/AlphaCalcTest.h @@ -55,7 +55,7 @@ public: { TS_ASSERT_EQUALS(alphaCalc.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } @@ -82,7 +82,7 @@ public: { TS_ASSERT_EQUALS(alphaCalc.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } diff --git a/Code/Mantid/Framework/Algorithms/test/BinaryOperateMasksTest.h b/Code/Mantid/Framework/Algorithms/test/BinaryOperateMasksTest.h index bc1866fbeaea21c570cc01ee4803ce5f786cac6b..ff05d52a73b9f73c1c69a64809e04f950b9b9ee1 100644 --- a/Code/Mantid/Framework/Algorithms/test/BinaryOperateMasksTest.h +++ b/Code/Mantid/Framework/Algorithms/test/BinaryOperateMasksTest.h @@ -64,7 +64,7 @@ public: TS_ASSERT_EQUALS(ws3->getValue(2), 0); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } @@ -114,7 +114,7 @@ public: // std::cout << ih << " - " << tempdetid << ": " << ws1->getValue(tempdetid) << " vs. " << ws4->getValue(tempdetid) << std::endl; } } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } @@ -133,7 +133,7 @@ public: TS_ASSERT_EQUALS(ws2->getValue(tempdetid), 1); } } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } diff --git a/Code/Mantid/Framework/Algorithms/test/CalMuonDeadTimeTest.h b/Code/Mantid/Framework/Algorithms/test/CalMuonDeadTimeTest.h index 092044f6a89183f80b509bbb8d3644e7c819f9e7..dd59581c76857e7d1f50300f7b5c50d3455191e2 100644 --- a/Code/Mantid/Framework/Algorithms/test/CalMuonDeadTimeTest.h +++ b/Code/Mantid/Framework/Algorithms/test/CalMuonDeadTimeTest.h @@ -60,7 +60,7 @@ public: { TS_ASSERT_EQUALS(calDeadTime.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } diff --git a/Code/Mantid/Framework/Algorithms/test/MuonAsymmetryCalcTest.h b/Code/Mantid/Framework/Algorithms/test/MuonAsymmetryCalcTest.h index 75c3205b0288a7a17b77eb9b43be8dc874b7b9cc..3ac55bb6c822f9b66fa4e856339c5ef5919702ad 100644 --- a/Code/Mantid/Framework/Algorithms/test/MuonAsymmetryCalcTest.h +++ b/Code/Mantid/Framework/Algorithms/test/MuonAsymmetryCalcTest.h @@ -78,7 +78,7 @@ public: { TS_ASSERT_EQUALS(asymCalc.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } diff --git a/Code/Mantid/Framework/Algorithms/test/MuonRemoveExpDecayTest.h b/Code/Mantid/Framework/Algorithms/test/MuonRemoveExpDecayTest.h index e66f67291e3d79613b650518ebab0522eb2f097e..a7b6d068e7de20bf383c0a3955658d53b0b28dff 100644 --- a/Code/Mantid/Framework/Algorithms/test/MuonRemoveExpDecayTest.h +++ b/Code/Mantid/Framework/Algorithms/test/MuonRemoveExpDecayTest.h @@ -62,7 +62,7 @@ public: { TS_ASSERT_EQUALS(alg.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } @@ -84,7 +84,7 @@ public: { TS_ASSERT_EQUALS(alg2.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } diff --git a/Code/Mantid/Framework/Algorithms/test/RemoveBinsTest.h b/Code/Mantid/Framework/Algorithms/test/RemoveBinsTest.h index 5853aa9d4437077ba2853911ceb09e88e9e98439..f8725b889271ae1acb504617a92a9062ce2689f1 100644 --- a/Code/Mantid/Framework/Algorithms/test/RemoveBinsTest.h +++ b/Code/Mantid/Framework/Algorithms/test/RemoveBinsTest.h @@ -53,7 +53,7 @@ public: { TS_ASSERT_EQUALS(alg.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } @@ -89,7 +89,7 @@ public: { TS_ASSERT_EQUALS(alg3.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } @@ -126,7 +126,7 @@ public: { TS_ASSERT_EQUALS(alg4.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); } @@ -197,7 +197,7 @@ public: { TS_ASSERT_EQUALS(alg2.execute(),true); } - catch(std::runtime_error e) + catch(std::runtime_error & e) { TS_FAIL(e.what()); }