MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/cpp-samples / ThrowIfNotOkay

Function ThrowIfNotOkay

getting-started/index_gcs_prefix.cc:55–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void ThrowIfNotOkay(std::string const& context,
56 google::cloud::Status const& status) {
57 if (status.ok()) return;
58 std::ostringstream os;
59 os << "error while " << context << " status=" << status;
60 throw std::runtime_error(std::move(os).str());
61}
62
63nlohmann::json LogFormat(std::string const& sev, std::string const& msg) {
64 return nlohmann::json{{"severity", sev}, {"message", msg}}.dump();

Callers 1

IndexGcsPrefixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected