mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
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:
parent
851dfc7f88
commit
27df4123c4
24 changed files with 78 additions and 82 deletions
|
|
@ -86,7 +86,7 @@ static bool AppInitRPC(int argc, char* argv[])
|
|||
}
|
||||
try {
|
||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||
} catch(std::exception &e) {
|
||||
} catch (const std::exception& e) {
|
||||
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
|
||||
return false;
|
||||
}
|
||||
|
|
@ -206,7 +206,7 @@ int CommandLineRPC(int argc, char *argv[])
|
|||
// Connection succeeded, no need to retry.
|
||||
break;
|
||||
}
|
||||
catch (const CConnectionFailed& e) {
|
||||
catch (const CConnectionFailed&) {
|
||||
if (fWait)
|
||||
MilliSleep(1000);
|
||||
else
|
||||
|
|
@ -214,10 +214,10 @@ int CommandLineRPC(int argc, char *argv[])
|
|||
}
|
||||
} while (fWait);
|
||||
}
|
||||
catch (boost::thread_interrupted) {
|
||||
catch (const boost::thread_interrupted&) {
|
||||
throw;
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
catch (const std::exception& e) {
|
||||
strPrint = string("error: ") + e.what();
|
||||
nRet = EXIT_FAILURE;
|
||||
}
|
||||
|
|
@ -240,7 +240,7 @@ int main(int argc, char* argv[])
|
|||
if(!AppInitRPC(argc, argv))
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
catch (const std::exception& e) {
|
||||
PrintExceptionContinue(&e, "AppInitRPC()");
|
||||
return EXIT_FAILURE;
|
||||
} catch (...) {
|
||||
|
|
@ -252,7 +252,7 @@ int main(int argc, char* argv[])
|
|||
try {
|
||||
ret = CommandLineRPC(argc, argv);
|
||||
}
|
||||
catch (std::exception& e) {
|
||||
catch (const std::exception& e) {
|
||||
PrintExceptionContinue(&e, "CommandLineRPC()");
|
||||
} catch (...) {
|
||||
PrintExceptionContinue(NULL, "CommandLineRPC()");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue