Browse Source

Merge pull request #3736

a719903 Fix bitcoin-cli exit status code (Cozz Lovan)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
3480bf7c65
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 11
      src/bitcoin-cli.cpp
  2. 2
      src/rpcclient.cpp

11
src/bitcoin-cli.cpp

@ -6,6 +6,7 @@ @@ -6,6 +6,7 @@
#include "util.h"
#include "init.h"
#include "rpcclient.h"
#include "rpcprotocol.h"
#include "ui_interface.h" /* for _(...) */
#include "chainparams.h"
@ -55,23 +56,25 @@ int main(int argc, char* argv[]) @@ -55,23 +56,25 @@ int main(int argc, char* argv[])
try
{
if(!AppInitRPC(argc, argv))
return 1;
return abs(RPC_MISC_ERROR);
}
catch (std::exception& e) {
PrintExceptionContinue(&e, "AppInitRPC()");
return abs(RPC_MISC_ERROR);
} catch (...) {
PrintExceptionContinue(NULL, "AppInitRPC()");
return abs(RPC_MISC_ERROR);
}
int ret = abs(RPC_MISC_ERROR);
try
{
if(!CommandLineRPC(argc, argv))
return 1;
ret = CommandLineRPC(argc, argv);
}
catch (std::exception& e) {
PrintExceptionContinue(&e, "CommandLineRPC()");
} catch (...) {
PrintExceptionContinue(NULL, "CommandLineRPC()");
}
return 0;
return ret;
}

2
src/rpcclient.cpp

@ -233,7 +233,7 @@ int CommandLineRPC(int argc, char *argv[]) @@ -233,7 +233,7 @@ int CommandLineRPC(int argc, char *argv[])
}
catch (std::exception& e) {
strPrint = string("error: ") + e.what();
nRet = 87;
nRet = abs(RPC_MISC_ERROR);
}
catch (...) {
PrintException(NULL, "CommandLineRPC()");

Loading…
Cancel
Save