diff options
Diffstat (limited to 'src/bitcoin-cli.cpp')
| -rw-r--r-- | src/bitcoin-cli.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 51a746f84..ca6950a16 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -27,7 +27,12 @@ static bool AppInitRPC(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"); @@ -37,9 +42,9 @@ static bool AppInitRPC(int argc, char* argv[]) if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help")) { // First part of help message is specific to RPC client - std::string strUsage = _("Bitcoin RPC client version") + " " + FormatFullVersion() + "\n\n" + + std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n\n" + _("Usage:") + "\n" + - " bitcoin-cli [options] <command> [params] " + _("Send command to Bitcoin server") + "\n" + + " bitcoin-cli [options] <command> [params] " + _("Send command to Bitcoin Core") + "\n" + " bitcoin-cli [options] help " + _("List commands") + "\n" + " bitcoin-cli [options] help <command> " + _("Get help for a command") + "\n"; |