title: Ethereum.on How to get error if chain is not added into metamask yet
body: <p>With this method app is listening for chain change:</p>
  <pre><code>    ethereum.on('chainChanged', (chainId) =&gt; {
  })
  </code></pre>
  <p>but if the chain to which the user is going is not added yet into metamask it throws :</p>
  <pre><code>inpage.js:1 MetaMask - RPC Error: Unrecognized chain ID &quot;0x89&quot;.
  Try adding the chain using wallet_addEthereumChain first. Object
  </code></pre>
  <p>of course, there is a method to add a new chain into metamask but how to catch this metamask error? try and catch outside ethereum.on gives nothing</p>
  <p>Thanks!</p>