Commit 94e03942 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

catch by const ref

parent c8272cb3
......@@ -367,7 +367,7 @@ void EEFSolv::setupConstants(const std::vector<AtomNumber> &atoms, std::vector<s
// Lookup atomtype in table or throw exception if its not there
try {
parameter_temp[i] = valuemap.at(Atype);
} catch (std::exception &e) {
} catch (const std::exception &e) {
log << "Type: " << Atype << " Name: " << Aname << " Residue: " << Rname << "\n";
error("Invalid atom type!\n");
}
......
......@@ -247,7 +247,7 @@ void GenericMolInfo::interpretSymbol( const std::string& symbol, std::vector<Ato
atoms.push_back(AtomNumber::serial(n));
}
ok=1;
} catch (Exception & e) {
} catch (const Exception & e) {
error_msg=e.what();
}
comm.Bcast(ok,0);
......
......@@ -603,7 +603,7 @@ void PlumedMain::cmd(const std::string & word,const TypesafePtr & val) {
}
}
} catch (std::exception &e) {
} catch (const std::exception &e) {
if(log.isOpen()) {
log<<"\n\n################################################################################\n\n";
log<<e.what();
......
......@@ -131,7 +131,7 @@ E.g., in an external c++ code using PLUMED as a library, one can type
\verbatim
try{
plumed.cmd("setPrecision",n);
} catch (std::exception & e) {
} catch (const std::exception & e) {
std::printf("ee %s",e.what());
exit(1);
}
......
......@@ -101,7 +101,7 @@ bool Tools::convertToInt(const std::string & str,T & t) {
// everything is fine, then store in t
t=tmp;
return true;
} catch(PLMD::lepton::Exception& exc) {
} catch(const PLMD::lepton::Exception& exc) {
}
return false;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment