Skip to content

Commit 04f5fc0

Browse files
committed
Update 2FA exception messages
1 parent e014b1f commit 04f5fc0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

vk_api/vk_api.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def _vk_login(self, captcha_sid=None, captcha_key=None):
289289
raise BadPassword('Bad password')
290290

291291
if 'act=authcheck' in response.text:
292-
self.logger.info('Two factor is required')
292+
self.logger.info('2FA is required')
293293

294294
response = self.http.get('https://vk.com/login?act=authcheck')
295295

@@ -320,8 +320,8 @@ def _pass_twofactor(self, auth_response):
320320

321321
if not auth_hash:
322322
raise TwoFactorError(
323-
'Two factor authentication can not be passed:'
324-
' could not find "hash" value. Please create a bugreport'
323+
'Two-factor authentication can not be passed:'
324+
' could not find "hash" value. Please send a bugreport'
325325
)
326326

327327
code, remember_device = self.error_handlers[TWOFACTOR_CODE]()
@@ -350,7 +350,10 @@ def _pass_twofactor(self, auth_response):
350350
elif status == '2':
351351
raise TwoFactorError('Recaptcha required')
352352

353-
raise TwoFactorError('Two factor authentication failed')
353+
raise TwoFactorError(
354+
'Two-factor authentication can not be passed.'
355+
' Please send a bugreport'
356+
)
354357

355358
def _pass_security_check(self, response=None):
356359
""" Функция для обхода проверки безопасности (запрос номера телефона)

0 commit comments

Comments
 (0)