Properly throw UnregisteredUserException in SignalServicePipe.
This commit is contained in:
parent
400c592acf
commit
8891b6c930
1 changed files with 4 additions and 1 deletions
|
@ -25,6 +25,7 @@ import org.whispersystems.signalservice.api.profiles.SignalServiceProfile;
|
|||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResponseCodeException;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.NotFoundException;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
|
||||
import org.whispersystems.signalservice.api.util.CredentialsProvider;
|
||||
import org.whispersystems.signalservice.internal.push.AttachmentV2UploadAttributes;
|
||||
import org.whispersystems.signalservice.internal.push.AttachmentV3UploadAttributes;
|
||||
|
@ -180,7 +181,9 @@ public class SignalServiceMessagePipe {
|
|||
ListenableFuture<WebsocketResponse> response = websocket.sendRequest(requestMessage);
|
||||
|
||||
return FutureTransformers.map(response, value -> {
|
||||
if (value.getStatus() < 200 || value.getStatus() >= 300) {
|
||||
if (value.getStatus() == 404) {
|
||||
throw new UnregisteredUserException(list.getDestination(), new NotFoundException("not found"));
|
||||
} else if (value.getStatus() < 200 || value.getStatus() >= 300) {
|
||||
throw new IOException("Non-successful response: " + value.getStatus());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue