Preserve legacy registration API error handling
This commit is contained in:
parent
515a863195
commit
448365c7a0
|
@ -967,7 +967,12 @@ public class AccountController {
|
||||||
return registrationServiceClient.createRegistrationSession(phoneNumber, REGISTRATION_RPC_TIMEOUT).join();
|
return registrationServiceClient.createRegistrationSession(phoneNumber, REGISTRATION_RPC_TIMEOUT).join();
|
||||||
} catch (final CompletionException e) {
|
} catch (final CompletionException e) {
|
||||||
rethrowRateLimitException(e);
|
rethrowRateLimitException(e);
|
||||||
throw e;
|
|
||||||
|
logger.debug("Failed to create session", e);
|
||||||
|
|
||||||
|
// Meet legacy client expectations by "swallowing" session creation exceptions and proceeding as if we had created
|
||||||
|
// a new session. Future operations on this "session" will always fail, but that's the legacy behavior.
|
||||||
|
return new byte[16];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -983,8 +988,11 @@ public class AccountController {
|
||||||
acceptLanguage.orElse(null),
|
acceptLanguage.orElse(null),
|
||||||
REGISTRATION_RPC_TIMEOUT).join();
|
REGISTRATION_RPC_TIMEOUT).join();
|
||||||
} catch (final CompletionException e) {
|
} catch (final CompletionException e) {
|
||||||
|
// Note that, to meet legacy client expectations, we'll ONLY rethrow rate limit exceptions. All others will be
|
||||||
|
// swallowed silently.
|
||||||
rethrowRateLimitException(e);
|
rethrowRateLimitException(e);
|
||||||
throw e;
|
|
||||||
|
logger.debug("Failed to send verification code", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue