本文整理匯總了Java中com.firebase.client.FirebaseError.EMAIL_TAKEN屬性的典型用法代碼示例。如果您正苦於以下問題:Java FirebaseError.EMAIL_TAKEN屬性的具體用法?Java FirebaseError.EMAIL_TAKEN怎麽用?Java FirebaseError.EMAIL_TAKEN使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.firebase.client.FirebaseError
的用法示例。
在下文中一共展示了FirebaseError.EMAIL_TAKEN屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSignUpErrorMessage
private String getSignUpErrorMessage(int code) {
String errorMessage = mContext.getString(R.string.signup_error_unknown);
switch (code) {
case FirebaseError.EMAIL_TAKEN:
errorMessage = mContext.getString(R.string.signup_error_email_taken);
break;
case FirebaseError.INVALID_EMAIL:
errorMessage = mContext.getString(R.string.signup_error_email_invalid);
break;
case FirebaseError.UNAVAILABLE:
errorMessage = mContext.getString(R.string.signup_error_username_taken);
break;
}
return errorMessage;
}
示例2: captureFirebaseError
/*************************************************************************************************
* Method: captureFirebaseError
* Description: upon receiving a firebase error, interpret this error and output to the system
* the type of error.
* Parameters: N/A
* Returned: N/A
************************************************************************************************/
public String captureFirebaseError (FirebaseError error)
{
String errorMessage = "Firebase Error.";
if (null != error)
{
switch (error.getCode())
{
case FirebaseError.EMAIL_TAKEN:
errorMessage = "Error: Email taken.";
break;
case FirebaseError.EXPIRED_TOKEN:
errorMessage = "Error: Expired token.";
break;
case FirebaseError.INVALID_EMAIL:
errorMessage = "Error: Invalid email.";
break;
case FirebaseError.INVALID_PASSWORD:
errorMessage = "Error: Invalid password.";
break;
case FirebaseError.INVALID_TOKEN:
errorMessage = "Error: Invalid token.";
break;
case FirebaseError.INVALID_CREDENTIALS:
errorMessage = "Error: Invalid credentials.";
break;
case FirebaseError.PERMISSION_DENIED:
errorMessage = "Error: Permission denied.";
break;
case FirebaseError.OPERATION_FAILED:
errorMessage = "Error: Operation failed.";
break;
default:
errorMessage = "Firebase error";
// System.out.println("Firebase error");
System.out.println("Firebase error");
break;
}
System.out.println(errorMessage);
}
return errorMessage;
}