Use AttachmentsV2 if the resumable upload link from V3 becomes corrupted.

This commit is contained in:
Alex Hart
2021-08-26 10:24:20 -03:00
committed by GitHub
parent ade6f60e76
commit 3f233ed39f
3 changed files with 29 additions and 5 deletions
@@ -0,0 +1,7 @@
package org.whispersystems.signalservice.api.push.exceptions;
public class NonSuccessfulResumableUploadResponseCodeException extends NonSuccessfulResponseCodeException {
public NonSuccessfulResumableUploadResponseCodeException(int code, String s) {
super(code, s);
}
}
@@ -59,6 +59,7 @@ import org.whispersystems.signalservice.api.push.exceptions.MalformedResponseExc
import org.whispersystems.signalservice.api.push.exceptions.MissingConfigurationException;
import org.whispersystems.signalservice.api.push.exceptions.NoContentException;
import org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResponseCodeException;
import org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResumableUploadResponseCodeException;
import org.whispersystems.signalservice.api.push.exceptions.NotFoundException;
import org.whispersystems.signalservice.api.push.exceptions.ProofRequiredException;
import org.whispersystems.signalservice.api.push.exceptions.PushNetworkException;
@@ -1374,7 +1375,7 @@ public class PushServiceSocket {
} else if (response.code() == 404) {
throw new ResumeLocationInvalidException();
} else {
throw new NonSuccessfulResponseCodeException(response.code(), "Response: " + response);
throw new NonSuccessfulResumableUploadResponseCodeException(response.code(), "Response: " + response);
}
} finally {
synchronized (connections) {