title: Firebase "OnCompleteListener" always returns successful
body: <p>In my code the OnCompleteListener is always successful, even if I get my device offline, so the data cant get uploaded. How can I get the information that the data is not successful uploaded?</p>
  
  <pre><code>DatabaseReference index = database.getReference("Events").child(event_name).child("comments");
  index.push().setValue(new Comment(newComment, userName)).addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
      @Override
      public void onComplete(@NonNull Task&lt;Void&gt; task) {
          if(task.isSuccessful()){
  
              finish();
  
          } else {
  
              Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show();
  
          }
      }
  });
  </code></pre>