title: Customize Exception Message for a Integer convertion - Ruby
body: <p>I am trying to do a safe_Int(n).</p>
  
  <p>If the input is not an "integerble" value (ex: 123 or '123') it should return a TypeError and the message: "#{n} must be a number".</p>
  
  <p>Here is what I did:</p>
  
  <pre><code>def safe_Int(n)
   begin
    Integer(n) rescue TypeError
   rescue TypeError =&gt; e
    puts "#{n} is not a number" 
   end 
  end
  </code></pre>
  
  <p>I am not able to display the message that I want. </p>
  
  <p>I am getting "no implicit conversion of Class into Integer"</p>
  
  <p>How can I customize the error message?</p>