MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / throwOnError

Function throwOnError

deps/cpp-statsd-client/tests/testStatsdClient.cpp:35–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template <typename SocketWrapper>
35void throwOnError(const SocketWrapper& wrapped, bool expectEmpty = true, const std::string& extraMessage = "") {
36 if (wrapped.errorMessage().empty() != expectEmpty) {
37 std::cerr << (expectEmpty ? wrapped.errorMessage() : extraMessage) << std::endl;
38 throw std::runtime_error(expectEmpty ? wrapped.errorMessage() : extraMessage);
39 }
40}
41
42void throwOnWrongMessage(StatsdServer& server, const std::string& expected) {
43 auto actual = server.receive();

Callers 3

testErrorConditionsFunction · 0.85
testReconfigureFunction · 0.85
testSendRecvFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected