zmq: use std::string in zmqError() #22200

pull fanquake wants to merge 2 commits into bitcoin:master from fanquake:zmqerror_use_std_string changing 2 files +8 −4
  1. fanquake commented at 7:21 AM on June 9, 2021: member

    This is two minor changes. The first is to change zmqError to take a const std::string& instead of a const char*. The second is to change the second portion of zmqError to print msg: message rather than errno=message, given that zmq_strerror returns a message. To me, this seems more readable / useful than output like: Error: Unable to initialize context errno=No such file or directory.

  2. fanquake added the label RPC/REST/ZMQ on Jun 9, 2021
  3. fanquake requested review from instagibbs on Jun 9, 2021
  4. theStack commented at 9:29 AM on June 9, 2021: member

    Concept ACK

    nit: Not sure if we have it in the coding guidelines, but I think we almost always pass std::strings by reference rather than by value (see e.g. git grep "(.*const std::string.*)")

  5. zmq: use std::string in zmqError() 9a7cb57bbc
  6. zmq: use msg: prefix over errno= in zmqError
    zmq_strerror() converts the passed errno into a description, meaning
    currently you have output like: "errno=No such file or directory".
    
    Using msg: would seem to make more sense here.
    3f05a9e681
  7. fanquake force-pushed on Jun 9, 2021
  8. fanquake commented at 11:34 AM on June 9, 2021: member

    always pass std::strings by reference

    Thanks, addressed.

  9. theStack approved
  10. theStack commented at 11:51 AM on June 9, 2021: member

    Code-Review ACK 3f05a9e681c4b72d99ddda8ccb6911d6ffad44ec

  11. practicalswift commented at 12:15 PM on June 9, 2021: contributor

    cr ACK 3f05a9e681c4b72d99ddda8ccb6911d6ffad44ec

  12. MarcoFalke merged this on Jun 9, 2021
  13. MarcoFalke closed this on Jun 9, 2021

  14. sidhujag referenced this in commit b9fafb69fc on Jun 9, 2021
  15. fanquake deleted the branch on Jun 10, 2021
  16. PastaPastaPasta referenced this in commit 13a1c5720e on Sep 21, 2021
  17. PastaPastaPasta referenced this in commit 28c1396015 on Sep 24, 2021
  18. kittywhiskers referenced this in commit 35159fecb1 on Oct 12, 2021
  19. gwillen referenced this in commit fbe798102e on Jun 1, 2022
  20. DrahtBot locked this on Aug 18, 2022

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 15:14 UTC

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