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:
@@ -507,7 +507,13 @@ int main(int argc, char *argv[])
|
||||
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(mapArgs["-datadir"])));
|
||||
return 1;
|
||||
}
|
||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||
try {
|
||||
ReadConfigFile(mapArgs, mapMultiArgs);
|
||||
} catch(std::exception &e) {
|
||||
QMessageBox::critical(0, QObject::tr("Bitcoin"),
|
||||
QObject::tr("Error: Cannot parse configuration file: %1. Only use key=value syntax.").arg(e.what()));
|
||||
return false;
|
||||
}
|
||||
|
||||
/// 7. Determine network (and switch to network specific options)
|
||||
// - Do not call Params() before this step
|
||||
|
||||
Reference in New Issue
Block a user