fix: честные ошибки при вводе пароля и дубликат в Keychain

This commit is contained in:
klockky
2026-08-22 13:52:09 +03:00
parent 04235e0972
commit d9e29f8651
6 changed files with 79 additions and 18 deletions
@@ -290,6 +290,12 @@ class WrongDeviceTokenException implements Exception {
String toString() => 'WrongDeviceTokenException';
}
class WrongPasswordException implements Exception {
const WrongPasswordException();
@override
String toString() => 'WrongPasswordException';
}
class RequestCodeResult {
final String token;
@@ -124,7 +124,7 @@ class TwoFactorModule extends AccountApiBase {
checkPacketError(packet, 'check2faPassword');
final data = packet.payload;
if (data is Map && data['error'] != null) {
throw Exception('Неверный пароль');
throw const WrongPasswordException();
}
}