mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Show error message if ReadConfigFile fails
A runaway exception was raised if ReadConfigFile fails (usually due to a parse error in bitcoin.conf). Show an error message instead. Fixes #4013.
This commit is contained in:
@@ -70,7 +70,13 @@ bool AppInit(int argc, char* argv[])
|
||||
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
|
||||
return false;
|
||||
}
|
||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||
try
|
||||
{
|
||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||
} catch(std::exception &e) {
|
||||
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
|
||||
return false;
|
||||
}
|
||||
// Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause)
|
||||
if (!SelectParamsFromCommandLine()) {
|
||||
fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
|
||||
|
||||
Reference in New Issue
Block a user