mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Improve pin failure message in dbus mode
This commit is contained in:
parent
5b76d7458f
commit
541ac777bc
1 changed files with 7 additions and 1 deletions
|
@ -81,8 +81,14 @@ public class DbusSignalControlImpl implements org.asamk.SignalControl {
|
|||
registrationManager.verifyAccount(verificationCode, pin);
|
||||
} catch (OverlappingFileLockException e) {
|
||||
throw new SignalControl.Error.Failure("Account is already in use");
|
||||
} catch (IOException | PinLockedException | IncorrectPinException e) {
|
||||
} catch (IOException e) {
|
||||
throw new SignalControl.Error.Failure(e.getClass().getSimpleName() + " " + e.getMessage());
|
||||
} catch (PinLockedException e) {
|
||||
throw new Error.Failure(
|
||||
"Verification failed! This number is locked with a pin. Hours remaining until reset: "
|
||||
+ (e.getTimeRemaining() / 1000 / 60 / 60));
|
||||
} catch (IncorrectPinException e) {
|
||||
throw new Error.Failure("Verification failed! Invalid pin, tries remaining: " + e.getTriesRemaining());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue