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

Function ThrowIfNotOkay

getting-started/gke/index_gcs.cc:141–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139using GetField = std::function<spanner::Value(gcs::ObjectMetadata const&)>;
140
141void ThrowIfNotOkay(std::string const& context,
142 google::cloud::Status const& status) {
143 if (status.ok()) return;
144 std::ostringstream os;
145 os << "error while " << context << " status=" << status;
146 throw std::runtime_error(std::move(os).str());
147}
148
149std::string LogFormat(std::string const& sev, std::string const& msg) {
150 return nlohmann::json{{"severity", sev}, {"message", msg}}.dump();

Callers 1

IndexGcsPrefixFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected