@Override public void onError(FirebaseError firebaseError) { mResultListener.onFinish(); int errCode = firebaseError.getCode(); if (errCode == FirebaseError.USER_DOES_NOT_EXIST) { mResultListener.onSuccess(); } else { mResultListener.onError(firebaseError.toException(), firebaseError.getMessage()); } }
/** * *********************************************************************************************** * 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; }
public UpdateEmailEvent(FirebaseError firebaseError) { mHasError = true; mCode = firebaseError.getCode(); mDetails = firebaseError.getDetails(); mMessage = firebaseError.getMessage(); }