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.
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-
fanquake commented at 7:21 AM on June 9, 2021: member
- fanquake added the label RPC/REST/ZMQ on Jun 9, 2021
- fanquake requested review from instagibbs on Jun 9, 2021
-
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.*)") -
zmq: use std::string in zmqError() 9a7cb57bbc
-
3f05a9e681
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.
- fanquake force-pushed on Jun 9, 2021
-
fanquake commented at 11:34 AM on June 9, 2021: member
always pass std::strings by reference
Thanks, addressed.
- theStack approved
-
theStack commented at 11:51 AM on June 9, 2021: member
Code-Review ACK 3f05a9e681c4b72d99ddda8ccb6911d6ffad44ec
-
practicalswift commented at 12:15 PM on June 9, 2021: contributor
cr ACK 3f05a9e681c4b72d99ddda8ccb6911d6ffad44ec
-
instagibbs commented at 12:50 PM on June 9, 2021: member
- MarcoFalke merged this on Jun 9, 2021
- MarcoFalke closed this on Jun 9, 2021
- sidhujag referenced this in commit b9fafb69fc on Jun 9, 2021
- fanquake deleted the branch on Jun 10, 2021
- PastaPastaPasta referenced this in commit 13a1c5720e on Sep 21, 2021
- PastaPastaPasta referenced this in commit 28c1396015 on Sep 24, 2021
- kittywhiskers referenced this in commit 35159fecb1 on Oct 12, 2021
- gwillen referenced this in commit fbe798102e on Jun 1, 2022
- DrahtBot locked this on Aug 18, 2022