Throw unregistered exception in getRegisteredUser

This commit is contained in:
AsamK 2021-12-25 16:13:07 +01:00
parent 7c9839b114
commit ceb6084eda

View file

@ -78,6 +78,7 @@ import org.whispersystems.signalservice.api.messages.SignalServiceTypingMessage;
import org.whispersystems.signalservice.api.push.ACI; import org.whispersystems.signalservice.api.push.ACI;
import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException; import org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException;
import org.whispersystems.signalservice.api.push.exceptions.UnregisteredUserException;
import org.whispersystems.signalservice.api.util.DeviceNameUtil; import org.whispersystems.signalservice.api.util.DeviceNameUtil;
import org.whispersystems.signalservice.api.util.InvalidNumberException; import org.whispersystems.signalservice.api.util.InvalidNumberException;
import org.whispersystems.signalservice.api.util.PhoneNumberFormatter; import org.whispersystems.signalservice.api.util.PhoneNumberFormatter;
@ -911,11 +912,11 @@ public class ManagerImpl implements Manager {
try { try {
aciMap = getRegisteredUsers(Set.of(number)); aciMap = getRegisteredUsers(Set.of(number));
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new IOException(number, e); throw new UnregisteredUserException(number, e);
} }
final var uuid = aciMap.get(number); final var uuid = aciMap.get(number);
if (uuid == null) { if (uuid == null) {
throw new IOException(number, null); throw new UnregisteredUserException(number, null);
} }
return uuid; return uuid;
} }