aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2014-12-07 13:29:06 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2014-12-17 09:39:24 +0100
commit27df4123c433e5ad4e5592f0a8fbc40ca933865b (patch)
tree90ca518364768b73da454b6f782130e13fd48ef3 /src/util.h
parent851dfc7f88d1b7c42534fffcfbdb2f1bcc473045 (diff)
downloadbitcoin-27df4123c433e5ad4e5592f0a8fbc40ca933865b.tar.xz
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
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util.h b/src/util.h
index a4aaf29f91..623c24f5cc 100644
--- a/src/util.h
+++ b/src/util.h
@@ -84,7 +84,7 @@ static inline bool error(const char* format)
return false;
}
-void PrintExceptionContinue(std::exception* pex, const char* pszThread);
+void PrintExceptionContinue(const std::exception *pex, const char* pszThread);
void ParseParameters(int argc, const char*const argv[]);
void FileCommit(FILE *fileout);
bool TruncateFile(FILE *file, unsigned int length);
@@ -186,12 +186,12 @@ template <typename Callable> void LoopForever(const char* name, Callable func,
func();
}
}
- catch (boost::thread_interrupted)
+ catch (const boost::thread_interrupted&)
{
LogPrintf("%s thread stop\n", name);
throw;
}
- catch (std::exception& e) {
+ catch (const std::exception& e) {
PrintExceptionContinue(&e, name);
throw;
}
@@ -214,12 +214,12 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
func();
LogPrintf("%s thread exit\n", name);
}
- catch (boost::thread_interrupted)
+ catch (const boost::thread_interrupted&)
{
LogPrintf("%s thread interrupt\n", name);
throw;
}
- catch (std::exception& e) {
+ catch (const std::exception& e) {
PrintExceptionContinue(&e, name);
throw;
}