Fix crashes during skip SMS flow.

This commit is contained in:
Cody Henthorne
2023-02-23 08:18:08 -05:00
parent 01351125f1
commit 1cffd88af2
5 changed files with 15 additions and 1 deletions
@@ -0,0 +1,3 @@
package org.whispersystems.signalservice.api.push.exceptions
class IncorrectRegistrationRecoveryPasswordException : NonSuccessfulResponseCodeException(403)
@@ -68,6 +68,7 @@ import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionExc
import org.whispersystems.signalservice.api.push.exceptions.ExpectationFailedException;
import org.whispersystems.signalservice.api.push.exceptions.ExternalServiceFailureException;
import org.whispersystems.signalservice.api.push.exceptions.HttpConflictException;
import org.whispersystems.signalservice.api.push.exceptions.IncorrectRegistrationRecoveryPasswordException;
import org.whispersystems.signalservice.api.push.exceptions.InvalidTransportModeException;
import org.whispersystems.signalservice.api.push.exceptions.MalformedResponseException;
import org.whispersystems.signalservice.api.push.exceptions.MissingConfigurationException;
@@ -2519,6 +2520,8 @@ public class PushServiceSocket {
@Override
public void handle(int responseCode, ResponseBody body) throws NonSuccessfulResponseCodeException, PushNetworkException {
switch (responseCode) {
case 403:
throw new IncorrectRegistrationRecoveryPasswordException();
case 404:
throw new NoSuchSessionException();
case 409: