summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2014-09-22 05:06:18 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2014-09-22 05:06:18 +0000
commit8ed905af0f2d288f054e93bd537ef60208a5f458 (patch)
tree41b1540fa99fa472aa6a0d12afabcddf7f4e81f3 /protocols/VKontakte/src/misc.cpp
parentc7a27d3642116b0e37b025dbb3d49dbb9a0f9e38 (diff)
VKontakte: rework errors handling code
git-svn-id: http://svn.miranda-ng.org/main/trunk@10552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 0457b460c4..40570adf24 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -96,14 +96,23 @@ bool CVkProto::CheckJsonResult(AsyncHttpRequest *pReq, NETLIBHTTPREQUEST *reply,
return true;
int iErrorCode = json_as_int(pErrorCode);
- if (iErrorCode == ERROR_ACCESS_DENIED)
+
+ switch (iErrorCode){
+ case VKERR_AUTHORIZATION_FAILED:
ConnectionFailed(LOGINERR_WRONGPASSWORD);
- else if (iErrorCode == 14) // captcha
+ break;
+ case VKERR_CAPTCHA_NEEDED:
ApplyCaptcha(pReq, pError);
- else if (iErrorCode == 6) {// Too many requests per second
+ break;
+ case VKERR_UNKNOWN:
+ case VKERR_TOO_MANY_REQ_PER_SEC:
+ case VKERR_FLOOD_CONTROL:
+ case VKERR_INTERNAL_SERVER_ERR:
pReq->bNeedsRestart = true;
- Sleep(330); //Pause for fix err 6
+ Sleep(500); //Pause for fix err
+ break;
}
+
return iErrorCode == 0;
}