title: Async await only output error message in catch
body: <p>I have the following async function:</p>
  <pre><code>async function register() {
    try {
      if (password1 !== password2) {
        throw &quot;Passwords do not match!&quot;;
      }
      await firebase.auth().createUserWithEmailAndPassword(email, password1)
    }
  
    } catch (err) {
      document.querySelector(&quot;#message&quot;).innerHTML = err;
      return;
    }
  </code></pre>
  <p>The first password match checks if the password entered by the user two times are identical. If they are, then use Firebase to create an account. But Firebase's <code>createUserWithEmailAndPassword</code> function return an <code>error</code> object that contains a <code>error.code</code> and a <code>error.message</code>. I only want to display the <code>error.message</code> and disregard the <code>error.code</code>. Is it possible to do it with the common <code>catch</code> block following the try, or I have to write a specific <code>catch</code> block for <code>createUserWithEmailAndPassword</code> to disregard the error code?</p>