Skip to content

Commit 179db62

Browse files
committed
Add phone prefix and phone postfix in SecurityCheck error.
1 parent 654a701 commit 179db62

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

vk_api/vk_api.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def security_check(self, url=None, response=None):
163163
if response.text.split('<!>')[4] == '4':
164164
return True
165165

166-
raise SecurityCheck('Enter number')
166+
raise SecurityCheck(phone_prefix, phone_postfix)
167167

168168
def check_sid(self):
169169
""" Прверка Cookies remixsid на валидность """
@@ -331,7 +331,14 @@ class BadPassword(AuthorizationError):
331331

332332

333333
class SecurityCheck(AuthorizationError):
334-
pass
334+
def __init__(self, phone_prefix, phone_postfix):
335+
self.phone_prefix = phone_prefix
336+
self.phone_postfix = phone_postfix
337+
338+
def __str__(self):
339+
return 'Security check. Enter number: {}...{}'.format(
340+
self.phone_prefix, self.phone_postfix
341+
)
335342

336343

337344
class ApiError(Exception):

0 commit comments

Comments
 (0)