title: Firebase doesn't catch error ( When pushing json offline )
body: <p>I'm trying to make an alert window saying there's an error, When trying to post a message offline. But the catch doesn't seem to ever work, Maybe it just works in other cases?
  here's my code :</p>
  
  <pre><code>  return (dispatch) =&gt; {
      dispatch({
        type: POST_TO_DB,
      });
      firebase.database().ref(locationInDB).push(object)
      .then((data) =&gt; {
        dispatch({
          type: POST_TRADE_TO_DB_SUCCESS,
        }); // success
      })
      .catch((err) =&gt; {
        console.log("failed to post...")
        dispatch({
          type: POST_TRADE_TO_DB_FAILED,
        }); // failed
      });
    };
  </code></pre>
  
  <p>Is there an alternative? Or am I doing something wrong?</p>