mirror of
https://github.com/signalapp/Signal-Server
synced 2026-07-07 14:35:55 +01:00
Handle "no sender available" error code from registration service
This commit is contained in:
committed by
Jon Chambers
parent
fe0956c8f7
commit
911feceacb
+2
@@ -183,6 +183,8 @@ public class RegistrationServiceClient implements Managed {
|
||||
RegistrationServiceSenderException.unknown(response.getError().getMayRetry()));
|
||||
case SEND_VERIFICATION_CODE_ERROR_TYPE_TRANSPORT_NOT_ALLOWED -> throw new CompletionException(
|
||||
new TransportNotAllowedException(buildSessionResponseFromMetadata(response.getSessionMetadata())));
|
||||
case SEND_VERIFICATION_CODE_ERROR_NO_SENDER_AVAILABLE -> throw new CompletionException(
|
||||
RegistrationServiceSenderException.unavailable(response.getError().getMayRetry()));
|
||||
|
||||
default -> throw new CompletionException(
|
||||
new RuntimeException("Failed to send verification code: " + response.getError().getErrorType()));
|
||||
|
||||
+4
@@ -28,6 +28,10 @@ public class RegistrationServiceSenderException extends Exception {
|
||||
return new RegistrationServiceSenderException(Reason.PROVIDER_UNAVAILABLE, permanent);
|
||||
}
|
||||
|
||||
public static RegistrationServiceSenderException unavailable(final boolean permanent) {
|
||||
return new RegistrationServiceSenderException(Reason.PROVIDER_UNAVAILABLE, permanent);
|
||||
}
|
||||
|
||||
private RegistrationServiceSenderException(final Reason reason, final boolean permanent) {
|
||||
super(null, null, true, false);
|
||||
this.reason = reason;
|
||||
|
||||
@@ -345,6 +345,11 @@ enum SendVerificationCodeErrorType {
|
||||
*/
|
||||
SEND_VERIFICATION_CODE_ERROR_TYPE_SUSPECTED_FRAUD = 7;
|
||||
|
||||
/**
|
||||
* No senders are available for the requested region/transport
|
||||
*/
|
||||
SEND_VERIFICATION_CODE_ERROR_NO_SENDER_AVAILABLE = 8;
|
||||
|
||||
}
|
||||
|
||||
message CheckVerificationCodeRequest {
|
||||
|
||||
Reference in New Issue
Block a user