2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-31 05:45:11 +00:00

onEvent: Log error string in case of an error in the async callback.

This commit is contained in:
Vibhav Pant
2023-11-07 13:41:03 +05:30
parent 85ae0263e8
commit f090ff730c

View File

@@ -280,6 +280,9 @@ void MegaCmdGlobalListener::onEvent(MegaApi *api, MegaEvent *event)
{
if (e->getValue() != MegaError::API_OK)
{
// We don't have access to MegaCmdExecuter's error handling methods here
std::string errorString(e->getErrorString());
LOG_err << "Failed to get user data: " << errorString;
return;
}
api->getAccountDetails(new MegaCmdListenerFuncExecuter(
@@ -287,6 +290,8 @@ void MegaCmdGlobalListener::onEvent(MegaApi *api, MegaEvent *event)
{
if (e->getValue() != MegaError::API_OK)
{
std::string errorString(e->getErrorString());
LOG_err << "Failed to get account details: " << errorString;
return;
}
std::unique_ptr<char[]> myEmail(api->getMyEmail());