From: Andrzej Popowski Date: Fri, 13 Feb 2015 14:48:33 +0000 (+0100) Subject: [Account] - function getAccount fixed X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~443 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a68abfd016180a003d82bcc40715c13b86f0f8d;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Account] - function getAccount fixed Change-Id: Ic303753a4fd292f38f7f14f1d209bb988554d997 Signed-off-by: Andrzej Popowski --- diff --git a/src/account/account_manager.cc b/src/account/account_manager.cc index fc5250f1..88610c86 100644 --- a/src/account/account_manager.cc +++ b/src/account/account_manager.cc @@ -166,7 +166,7 @@ void AccountManager::GetAccountsInfo(const std::string& application_id, } } -bool AccountManager::GetAccountInfo(int account_id, picojson::object& out) { +void AccountManager::GetAccountInfo(int account_id, picojson::object& out) { LoggerD("Enter"); account_h account = NULL; @@ -178,27 +178,31 @@ bool AccountManager::GetAccountInfo(int account_id, picojson::object& out) { 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, diff --git a/src/account/account_manager.h b/src/account/account_manager.h index 5148b320..1309cf36 100644 --- a/src/account/account_manager.h +++ b/src/account/account_manager.h @@ -29,7 +29,7 @@ class AccountManager { * 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"].