| 47 | } |
| 48 | |
| 49 | ACTOR 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 | |
| 65 | void addInterfacesFromKVs(RangeResult& kvs, |
| 66 | std::map<Key, std::pair<Value, ClientLeaderRegInterface>>* address_interface) { |
nothing calls this directly
no test coverage detected