mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-30 16:54:19 +00:00
Merge pull request #3749
4423571 Replace PrintException with PrintExceptionContinue + throw (Wladimir J. van der Laan)
This commit is contained in:
commit
b81f9718df
@ -236,7 +236,8 @@ int CommandLineRPC(int argc, char *argv[])
|
|||||||
nRet = abs(RPC_MISC_ERROR);
|
nRet = abs(RPC_MISC_ERROR);
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
PrintException(NULL, "CommandLineRPC()");
|
PrintExceptionContinue(NULL, "CommandLineRPC()");
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strPrint != "")
|
if (strPrint != "")
|
||||||
|
@ -948,15 +948,6 @@ void LogException(std::exception* pex, const char* pszThread)
|
|||||||
LogPrintf("\n%s", message);
|
LogPrintf("\n%s", message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintException(std::exception* pex, const char* pszThread)
|
|
||||||
{
|
|
||||||
std::string message = FormatException(pex, pszThread);
|
|
||||||
LogPrintf("\n\n************************\n%s\n", message);
|
|
||||||
fprintf(stderr, "\n\n************************\n%s\n", message.c_str());
|
|
||||||
strMiscWarning = message;
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PrintExceptionContinue(std::exception* pex, const char* pszThread)
|
void PrintExceptionContinue(std::exception* pex, const char* pszThread)
|
||||||
{
|
{
|
||||||
std::string message = FormatException(pex, pszThread);
|
std::string message = FormatException(pex, pszThread);
|
||||||
|
13
src/util.h
13
src/util.h
@ -164,7 +164,6 @@ static inline bool error(const char* format)
|
|||||||
|
|
||||||
|
|
||||||
void LogException(std::exception* pex, const char* pszThread);
|
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 PrintExceptionContinue(std::exception* pex, const char* pszThread);
|
||||||
void ParseString(const std::string& str, char c, std::vector<std::string>& v);
|
void ParseString(const std::string& str, char c, std::vector<std::string>& v);
|
||||||
std::string FormatMoney(int64_t n, bool fPlus=false);
|
std::string FormatMoney(int64_t n, bool fPlus=false);
|
||||||
@ -558,10 +557,12 @@ template <typename Callable> void LoopForever(const char* name, Callable func,
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (std::exception& e) {
|
catch (std::exception& e) {
|
||||||
PrintException(&e, name);
|
PrintExceptionContinue(&e, name);
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
PrintException(NULL, name);
|
PrintExceptionContinue(NULL, name);
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// .. and a wrapper that just calls func once
|
// .. and a wrapper that just calls func once
|
||||||
@ -581,10 +582,12 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
catch (std::exception& e) {
|
catch (std::exception& e) {
|
||||||
PrintException(&e, name);
|
PrintExceptionContinue(&e, name);
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
catch (...) {
|
catch (...) {
|
||||||
PrintException(NULL, name);
|
PrintExceptionContinue(NULL, name);
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user