From 5f47c26a8581305abe9b4d9cda646f9f0dc09805 Mon Sep 17 00:00:00 2001 From: aunsane Date: Sun, 25 Mar 2018 21:19:17 +0300 Subject: CloudFile: show error if authorization goes wrong --- plugins/CloudFile/src/Services/yandex_service.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'plugins/CloudFile/src/Services/yandex_service.cpp') diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index 6e471d18f9..97ce0eda46 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -93,22 +93,25 @@ unsigned CYandexService::RequestAccessTokenThread(void *owner, void *param) : service->HttpStatusToError(response->resultCode); Netlib_Logf(service->m_hConnection, "%s: %s", service->GetAccountName(), error); - //ShowNotification(TranslateT("server does not respond"), MB_ICONERROR); + ShowNotification(TranslateT("Server does not respond"), MB_ICONERROR); + EndDialog(hwndDlg, 0); return 0; } JSONNode root = JSONNode::parse(response->pData); if (root.empty()) { Netlib_Logf(service->m_hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError(response->resultCode)); - //ShowNotification(TranslateT("server does not respond"), MB_ICONERROR); + ShowNotification(TranslateT("Server does not respond"), MB_ICONERROR); + EndDialog(hwndDlg, 0); return 0; } JSONNode node = root.at("error_description"); if (!node.isnull()) { - ptrW error_description(mir_a2u_cp(node.as_string().c_str(), CP_UTF8)); + CMStringW error_description = node.as_mstring(); Netlib_Logf(service->m_hConnection, "%s: %s", service->GetAccountName(), service->HttpStatusToError(response->resultCode)); - //ShowNotification((wchar_t*)error_description, MB_ICONERROR); + ShowNotification(error_description, MB_ICONERROR); + EndDialog(hwndDlg, 0); return 0; } -- cgit v1.2.3