From 44235713ed0ad1810328f21108d32bbac04de87b Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Wed, 26 Feb 2014 13:23:52 +0100 Subject: Replace PrintException with PrintExceptionContinue + throw Just a pet peeve. (PrintException has exactly the same body as PrintExceptionContinue but does a re-throw at the end. Move these re-throws to the call site, this aids understanding what is going on as well as eliminates a bit of code duplication in util.cpp) --- src/util.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index 6ef93021fd..8b1b7cd2aa 100644 --- a/src/util.h +++ b/src/util.h @@ -172,7 +172,6 @@ static inline bool error(const char* format) void LogException(std::exception* pex, const char* pszThread); -void PrintException(std::exception* pex, const char* pszThread); void PrintExceptionContinue(std::exception* pex, const char* pszThread); void ParseString(const std::string& str, char c, std::vector& v); std::string FormatMoney(int64_t n, bool fPlus=false); @@ -566,10 +565,12 @@ template void LoopForever(const char* name, Callable func, throw; } catch (std::exception& e) { - PrintException(&e, name); + PrintExceptionContinue(&e, name); + throw; } catch (...) { - PrintException(NULL, name); + PrintExceptionContinue(NULL, name); + throw; } } // .. and a wrapper that just calls func once @@ -589,10 +590,12 @@ template void TraceThread(const char* name, Callable func) throw; } catch (std::exception& e) { - PrintException(&e, name); + PrintExceptionContinue(&e, name); + throw; } catch (...) { - PrintException(NULL, name); + PrintExceptionContinue(NULL, name); + throw; } } -- cgit v1.2.3