MCPcopy Create free account
hub / github.com/apple/foundationdb / string> getSpecialKeysFailureErrorMessage

Method string> getSpecialKeysFailureErrorMessage

fdbcli/Util.actor.cpp:49–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49ACTOR Future<std::string> getSpecialKeysFailureErrorMessage(Reference<ITransaction> tr) {
50 // hold the returned standalone object's memory
51 state ThreadFuture<Optional<Value>> errorMsgF = tr->get(fdb_cli::errorMsgSpecialKey);
52 Optional<Value> errorMsg = wait(safeThreadFutureToFuture(errorMsgF));
53 // Error message should be present
54 ASSERT(errorMsg.present());
55 // Read the json string
56 auto valueObj = readJSONStrictly(errorMsg.get().toString()).get_obj();
57 // verify schema
58 auto schema = readJSONStrictly(JSONSchemas::managementApiErrorSchema.toString()).get_obj();
59 std::string errorStr;
60 ASSERT(schemaMatch(schema, valueObj, errorStr, SevError, true));
61 // return the error message
62 return valueObj["message"].get_str();
63}
64
65void addInterfacesFromKVs(RangeResult& kvs,
66 std::map<Key, std::pair<Value, ClientLeaderRegInterface>>* address_interface) {

Callers

nothing calls this directly

Calls 6

safeThreadFutureToFutureFunction · 0.85
readJSONStrictlyFunction · 0.85
schemaMatchFunction · 0.85
getMethod · 0.65
presentMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected