mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-11-27 07:49:28 +00:00
Handle too many request error on create account form.
This commit is contained in:
parent
b8f732d82b
commit
2f892b4ea4
@ -12,6 +12,11 @@ public enum CreateAccountResult {
|
||||
*/
|
||||
SUCCESS,
|
||||
|
||||
/**
|
||||
* Too many account creation requests
|
||||
*/
|
||||
ERROR_TOO_MANY_REQUESTS,
|
||||
|
||||
/**
|
||||
* Trying to login with an existing email address
|
||||
*/
|
||||
|
@ -209,6 +209,9 @@ public class AccountHelper {
|
||||
case 409:
|
||||
return CreateAccountResult.ERROR_EXISTING_EMAIL;
|
||||
|
||||
case 429:
|
||||
return CreateAccountResult.ERROR_TOO_MANY_REQUESTS;
|
||||
|
||||
default:
|
||||
return CreateAccountResult.ERROR;
|
||||
|
||||
|
@ -250,6 +250,11 @@ public class CreateAccountActivity extends AppCompatActivity
|
||||
int message = R.string.err_while_creating_account;
|
||||
switch (result){
|
||||
|
||||
//Too many account creation requests
|
||||
case ERROR_TOO_MANY_REQUESTS:
|
||||
message = R.string.err_create_account_too_many_requests;
|
||||
break;
|
||||
|
||||
//Existing email address
|
||||
case ERROR_EXISTING_EMAIL:
|
||||
message = R.string.err_create_account_existing_email;
|
||||
|
@ -234,4 +234,5 @@
|
||||
<string name="account_created_sign_in">Sign in</string>
|
||||
<string name="activity_login_too_many_request">Too many failed login requests. Please try again later…</string>
|
||||
<string name="err_create_account_existing_email">This email address is already associated with an account!</string>
|
||||
<string name="err_create_account_too_many_requests">Too many account creation requests. Please try again later...</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user