title: try is not catching a non-integer input
body: <p>What I want to achieve is simple, if the input is not an integer it should display "Number is invalid".</p>
  
  <p>Number is already set to be an integer (<code>int number</code>).</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main(){
      int number;
      try{
          cin &gt;&gt; number;
      }catch(const ios::failure &amp;){
          cout &lt;&lt; "Number is invalid";
      }
  }
  </code></pre>
  
  <p>Result for input -> 1 is => 1 and result for input -> a is => a, so it is not catching anything.</p>
  
  <p>What am I missing in this try-catch block? </p>