make all catch() arguments const

- I saw this on http://en.cppreference.com/w/cpp/language/try_catch and
  thought it would be a good idea
- also unify used format to better be able to search for exception
  uses in our codebase
This commit is contained in:
Philip Kaufmann
2014-12-07 13:29:06 +01:00
parent 851dfc7f88
commit 27df4123c4
24 changed files with 78 additions and 82 deletions

View File

@@ -601,7 +601,7 @@ int CNetMessage::readHeader(const char *pch, unsigned int nBytes)
try {
hdrbuf >> hdr;
}
catch (const std::exception &) {
catch (const std::exception&) {
return -1;
}
@@ -1068,7 +1068,7 @@ void ThreadMapPort()
MilliSleep(20*60*1000); // Refresh every 20 minutes
}
}
catch (boost::thread_interrupted)
catch (const boost::thread_interrupted&)
{
r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), "TCP", 0);
LogPrintf("UPNP_DeletePortMapping() returned : %d\n", r);
@@ -1854,7 +1854,7 @@ bool CAddrDB::Write(const CAddrMan& addr)
try {
fileout << ssPeers;
}
catch (std::exception &e) {
catch (const std::exception& e) {
return error("%s : Serialize or I/O error - %s", __func__, e.what());
}
FileCommit(fileout.Get());
@@ -1890,7 +1890,7 @@ bool CAddrDB::Read(CAddrMan& addr)
filein.read((char *)&vchData[0], dataSize);
filein >> hashIn;
}
catch (std::exception &e) {
catch (const std::exception& e) {
return error("%s : Deserialize or I/O error - %s", __func__, e.what());
}
filein.fclose();
@@ -1914,7 +1914,7 @@ bool CAddrDB::Read(CAddrMan& addr)
// de-serialize address data into one CAddrMan object
ssPeers >> addr;
}
catch (std::exception &e) {
catch (const std::exception& e) {
return error("%s : Deserialize or I/O error - %s", __func__, e.what());
}