本文整理汇总了Java中com.firebase.client.FirebaseError.getCode方法的典型用法代码示例。如果您正苦于以下问题:Java FirebaseError.getCode方法的具体用法?Java FirebaseError.getCode怎么用?Java FirebaseError.getCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.firebase.client.FirebaseError
的用法示例。
在下文中一共展示了FirebaseError.getCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCancelled
import com.firebase.client.FirebaseError; //导入方法依赖的package包/类
@Override
public void onCancelled(FirebaseError firebaseError) {
if (firebaseError.getCode() != FirebaseError.PERMISSION_DENIED) {
onError(firebaseError);
return;
}
if (firebaseReAuthTask != null) {
return;
}
firebaseReAuthTask = codementorTasks.extractAppData()
.onSuccessTask(task -> firebaseTasks.authenticate(task.getResult(), true))
.onSuccess(this::onReAuthSuccessful, UI)
.continueWith(this::onReAuthCompleted, UI);
}
示例2: onAuthenticationError
import com.firebase.client.FirebaseError; //导入方法依赖的package包/类
@Override
public void onAuthenticationError (FirebaseError firebaseError)
{
mAuthProgressDialog.dismiss();
//TODO: refactor this to nice function.
//we want to the function to set the text fields based on the error.
//so it will probz look at all the email errors - mEmailView.setError("")
//same thing with mEditPassword
//also want to use the same idea for the createAccount page and PassRecovery
if (firebaseError.getCode() == FirebaseError.INVALID_PASSWORD)
{
mEditPassword.setError("Invalid password.");
}
}
示例3: onError
import com.firebase.client.FirebaseError; //导入方法依赖的package包/类
@Override
public void onError(FirebaseError firebaseError) {
progressDialog.dismiss();
switch(firebaseError.getCode()) {
case FirebaseError.INVALID_PASSWORD:
Toast.makeText(getActivity(), R.string.error_change_password, Toast.LENGTH_SHORT).show();
break;
default:
Toast.makeText(getActivity(), R.string.error_no_internet, Toast.LENGTH_SHORT).show();
}
}
示例4: getFirebaseErrorDescription
import com.firebase.client.FirebaseError; //导入方法依赖的package包/类
@NonNull
private static String getFirebaseErrorDescription(FirebaseError firebaseError) {
return firebaseError.getCode() + " - " + firebaseError.getMessage() + " \n" + firebaseError.getDetails();
}
示例5: captureFirebaseError
import com.firebase.client.FirebaseError; //导入方法依赖的package包/类
/*************************************************************************************************
* 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;
}