Trivial: Add common failure cases for rpc server connection failure #9073

pull instagibbs wants to merge 1 commits into bitcoin:master from instagibbs:rpcnoconnectstring changing 1 files +1 −1
  1. instagibbs commented at 1:57 PM on November 3, 2016: member

    As of now if you're not familiar with the other error responses, you might not know why connection failed. Give common reasons for this particular error message.

  2. MarcoFalke added the label Docs and Output on Nov 3, 2016
  3. in src/bitcoin-cli.cpp:None in b765a71df2 outdated
     239 | @@ -240,7 +240,7 @@ UniValue CallRPC(const string& strMethod, const UniValue& params)
     240 |      event_base_free(base);
     241 |  
     242 |      if (response.status == 0)
     243 | -        throw CConnectionFailed(strprintf("couldn't connect to server (%d %s)", response.error, http_errorstring(response.error)));
     244 | +        throw CConnectionFailed(strprintf("couldn't connect to server (make sure server is running and you are connecting to the correct RPC port : %d %s)", response.error, http_errorstring(response.error)));
    


    paveljanik commented at 3:39 PM on November 3, 2016:

    nit: please remove space before :.

  4. instagibbs force-pushed on Nov 3, 2016
  5. laanwj commented at 3:54 PM on November 3, 2016: member

    Concept ACK, but I think this message is becoming too long to be crammed into one line. I think it'd make sense to write it out over multiple lines, e.g. leave the last line for the detailed error message (if any).

  6. Add common failure cases for rpc server connection failure 8f329f991b
  7. instagibbs force-pushed on Nov 3, 2016
  8. instagibbs commented at 4:11 PM on November 3, 2016: member

    added newline to break it up some of the text

  9. MarcoFalke commented at 4:47 PM on November 3, 2016: member

    utACK 8f329f991bc81ddcfb4f51574e2003edde14e996

  10. laanwj commented at 6:19 PM on November 3, 2016: member

    Tested ACK 8f329f9

  11. laanwj merged this on Nov 3, 2016
  12. laanwj closed this on Nov 3, 2016

  13. laanwj referenced this in commit 82077ef6e4 on Nov 3, 2016
  14. laanwj commented at 7:12 AM on November 23, 2016: member

    This is a bit confusing now:

    $ cli getinfo
    error: couldn't connect to server
    (make sure server is running and you are connecting to the correct RPC port: -1 unknown)
    

    If you don't know better it seems like the port is unknown. I think this would be better:

    $ cli getinfo
    error: couldn't connect to server: unknown (-1)
    (make sure server is running and you are connecting to the correct RPC port)
    
  15. laanwj referenced this in commit fe37fbe606 on Dec 2, 2016
  16. zkbot referenced this in commit b0afc4ba1d on Mar 22, 2017
  17. zkbot referenced this in commit f9f48667be on Mar 25, 2017
  18. codablock referenced this in commit 5adb5b8e8a on Jan 13, 2018
  19. lateminer referenced this in commit a3810f39e9 on Jan 4, 2019
  20. andvgal referenced this in commit d5e7d65fc4 on Jan 6, 2019
  21. CryptoCentric referenced this in commit 3348f8023d on Feb 15, 2019
  22. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me