Add support for fetching remote deprecation.

This commit is contained in:
Greyson Parrelli
2020-09-08 18:03:56 -04:00
committed by GitHub
parent c946a7a1d5
commit 2784285d47
21 changed files with 559 additions and 39 deletions

View File

@@ -0,0 +1,4 @@
package org.whispersystems.signalservice.api.push.exceptions;
public class DeprecatedVersionException extends NonSuccessfulResponseCodeException {
}

View File

@@ -49,6 +49,7 @@ import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedE
import org.whispersystems.signalservice.api.push.exceptions.CaptchaRequiredException;
import org.whispersystems.signalservice.api.push.exceptions.ConflictException;
import org.whispersystems.signalservice.api.push.exceptions.ContactManifestMismatchException;
import org.whispersystems.signalservice.api.push.exceptions.DeprecatedVersionException;
import org.whispersystems.signalservice.api.push.exceptions.ExpectationFailedException;
import org.whispersystems.signalservice.api.push.exceptions.MissingConfigurationException;
import org.whispersystems.signalservice.api.push.exceptions.NoContentException;
@@ -1459,6 +1460,8 @@ public class PushServiceSocket {
throw new LockedException(accountLockFailure.length,
accountLockFailure.timeRemaining,
basicStorageCredentials);
case 499:
throw new DeprecatedVersionException();
}
if (responseCode != 200 && responseCode != 204) {
@@ -1688,6 +1691,8 @@ public class PushServiceSocket {
}
case 429:
throw new RateLimitException("Rate limit exceeded: " + response.code());
case 499:
throw new DeprecatedVersionException();
}
throw new NonSuccessfulResponseCodeException("Response: " + response);