This repository was archived by the owner on Oct 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 3838#include < libweb3jsonrpc/Debug.h>
3939#include < libweb3jsonrpc/Test.h>
4040
41+ #include < json_spirit/JsonSpiritHeaders.h>
42+
4143#include " MinerAux.h"
4244#include " AccountManager.h"
4345
@@ -49,6 +51,7 @@ using namespace dev::p2p;
4951using namespace dev ::eth;
5052namespace po = boost::program_options;
5153namespace fs = boost::filesystem;
54+ namespace js = json_spirit;
5255
5356namespace
5457{
@@ -680,16 +683,27 @@ int main(int argc, char** argv)
680683
681684 if (!configJSON.empty ())
682685 {
686+ bool chainConfigError = true ;
683687 try
684688 {
685689 chainParams = chainParams.loadConfig (configJSON, {}, configPath);
686690 chainConfigIsSet = true ;
691+ chainConfigError = false ;
692+ }
693+ catch (js::Error_position const & error)
694+ {
695+ cerr << " json parsing error detected on line " << error.line_ << " in column "
696+ << error.column_ << " : " << error.reason_ << " \n " ;
687697 }
688698 catch (...)
699+ {
700+ }
701+ if (chainConfigError)
689702 {
690703 cerr << " provided configuration is not well formatted\n " ;
691- cerr << " sample: \n " << genesisInfo (eth::Network::MainNetworkTest) << " \n " ;
692- return AlethErrors::Success;
704+ cerr << " good configuration sample: \n "
705+ << genesisInfo (eth::Network::MainNetworkTest) << " \n " ;
706+ return AlethErrors::ConfigFileInvalid;
693707 }
694708 }
695709
Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ enum AlethErrors
226226 UnknownArgument,
227227 UnknownMiningOption,
228228 ConfigFileEmptyOrNotFound,
229+ ConfigFileInvalid,
229230 UnknownNetworkType,
230231 BadNetworkIdOption,
231232 BadConfigOption,
You can’t perform that action at this time.
0 commit comments