title: How to catch a Firebase Storage error when the file doesn't exist?
body: <p>My react app displays an image if it exists in Firebase Storage:</p>
  <pre><code>
  import firebase from 'firebase/app';
  import 'firebase/storage';
  
  //...//
  
  const [imageUrl, setImageUrl] = useState(null)
  
  //..//
  
  firebase
    .storage()
    .ref('path_to_image')
    .getDownloadUrl()
    .then((v)=&gt;{setImageUrl(v)}) //This sets the imageUrl state. I still get the error even if I remove this line
    .catch(()=&gt;{setImageUrl(null)}
  </code></pre>
  <p>But I still get a 404 error logged in the console:</p>
  <blockquote>
  <p>GET http://.../v0/....appspot.com/o/userPhotos%2FJfYvcUGG8LkyNwyu1dKpJr6j4EKmE 404 (Not Found)</p>
  </blockquote>
  <p>I tried wrapping everything in a try/catch, but the error still gets logged.</p>
  <p>How can I catch the exception, or is there a way I could verify that the file exists before calling getDownloadUrl?</p>