title: Firebase on Android: How to check Firebase auth failed reason?
body: <p>I use Firebase on Android and Firebase Auth functions.</p>
  
  <p>I try <code>FirebaseAuth.signInWithEmailAndPassword</code> and in case it fails I want to know why the signIn process failed?</p>
  
  <p>The <code>signInWithEmailAndPassword</code> method has <code>addOnFailureListener</code> API.
  And I can catch the <code>Exception</code>(maybe <code>FirebaseAuthException</code>) in <code>onFailure</code> callback method.</p>
  
  <pre><code>auth.signInWithEmailAndPassword(loginRequest.id, loginRequest.password)
    .addOnFailureListener(new OnFailureListener() {
      @Override
      public void onFailure(@NonNull Exception e) {
        if (e instanceof FirebaseAuthException) {
          ((FirebaseAuthException) e).getErrorCode());
        }
      }
    });
  </code></pre>
  
  <p>I want to know why the SignIn process failed. in <code>onFailure</code>.</p>
  
  <p>I think it could be done as follows:</p>
  
  <ol>
  <li><code>e</code> instance type check(e instanceOf <code>FirebaseAuthInvalidUserException</code> or <code>FirebaseAuthInvalidCredentialsException</code> or ,,,)</li>
  <li><code>e.getErrorCode()</code> </li>
  </ol>
  
  <p>I do not want to type checks (it's dirty).<br>
  I prefer the way in choice 2. above. But I could not find the definition of <code>e.getErrorCode()</code> return values collection.
  e.g <code>ERROR_INVALID_EMAIL</code>, <code>ERROR_ACCOUNT_EXISTS_WITH_DIFFERENT_CREDENTIAL</code>, etc.
  (Where are they defined?)</p>
  
  <p>How do I find out why Firebase auth failed?</p>