Migrate to 429 for all ratelimit responses

This commit is contained in:
Katherine
2024-08-05 12:02:11 -07:00
committed by GitHub
parent 10d559bbb5
commit 0e4625ef88
33 changed files with 63 additions and 110 deletions

View File

@@ -97,8 +97,8 @@ public class RegistrationServiceClient implements Managed {
case CREATE_REGISTRATION_SESSION_ERROR_TYPE_RATE_LIMITED -> throw new CompletionException(
new RateLimitExceededException(response.getError().getMayRetry()
? Duration.ofSeconds(response.getError().getRetryAfterSeconds())
: null,
true));
: null
));
case CREATE_REGISTRATION_SESSION_ERROR_TYPE_ILLEGAL_PHONE_NUMBER -> throw new IllegalArgumentException();
default -> throw new RuntimeException(
"Unrecognized error type from registration service: " + response.getError().getErrorType());