}
}
-bool AccountManager::GetAccountInfo(int account_id, picojson::object& out) {
+void AccountManager::GetAccountInfo(int account_id, picojson::object& out) {
LoggerD("Enter");
account_h account = NULL;
if (ret != ACCOUNT_ERROR_NONE) {
LoggerE("Failed to create account info");
REPORT_ERROR(out, UnknownException(GetErrorMsg(ret)));
- return false;
+ return;
}
ret = account_query_account_by_account_id(account_id, &account);
- if (ret != ACCOUNT_ERROR_NONE) {
+ if (ACCOUNT_ERROR_RECORD_NOT_FOUND == ret) {
+ out["status"] = picojson::value("success");
+ out["result"] = picojson::value();
+ return;
+ } else if (ret != ACCOUNT_ERROR_NONE) {
LoggerE("Failed to get account info");
REPORT_ERROR(out, UnknownException(GetErrorMsg(ret)));
- return false;
+ return;
}
picojson::object info;
if (!ConvertAccountToObject(account, info)) {
LoggerE("Failed to convert account_h into object");
REPORT_ERROR(out, UnknownException("Unknown error occurs"));
- return false;
+ return;
}
out["status"] = picojson::value("success");
out["result"] = picojson::value(info);
- return true;
+ return;
}
bool AccountManager::GetProviderInfo(const std::string& provider_id,
* If status is "success", then the result(picojson::value) will be stored in out["result"].
* If status is "error", then the error(picojson::value) will be stored in out["error"].
*/
- bool GetAccountInfo(int account_id, picojson::object& out);
+ void GetAccountInfo(int account_id, picojson::object& out);
/* out["status"] = "success" or "error"
* If status is "success", then the result(picojson::value) will be stored in out["result"].