title: How can I catch unexpected error messages during Cypress test execution?
body: <p>I am using Cypress and iziToast (<a href="http://izitoast.marcelodolce.com/" rel="nofollow noreferrer">http://izitoast.marcelodolce.com/</a>) to run some tests on a web application.
  I spotted an unexpected error message whilst running it locally.
  I was able to catch it by adding the following cy.toast statement to my code:</p>
  
  <pre><code>cy.get(tabbedPanelControlsTitle)
      .should('have.value', 'Teams')
      .click();
  // this is causing the following unexpected error
  cy.toast({
      type: 'Error',
      code: 'E1527360562',
    });
  </code></pre>
  
  <p>I was able to get it to fail here using the following:</p>
  
  <pre><code>cy.wrap({ toast: 'Error' })
      .its('toast')
      .should('eq', 'Success');
  </code></pre>
  
  <p>What I would like to know is there any way of catching these unexpected errors?</p>
  
  <p>Toast Message: </p>
  
  <p><a href="https://i.stack.imgur.com/HvHUf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HvHUf.png" alt="enter image description here"></a></p>
  
  <p>Failing that, can I get the Network response to my click() command?</p>