title: How to display error type in ruby?
body: <p>in the following code</p>
  
  <pre><code>begin
   raise StandardError, 'message'
   #some code that raises a lot of exception
  rescue StandardError
   #handle error
  rescue OtherError
   #handle error
  rescue YetAnotherError
   #handle error
  end
  </code></pre>
  
  <p>I want to print a warning stating the type and the message of the error without adding print statement to each of the rescue clauses, like</p>
  
  <pre><code>begin
   raise StandardError, 'message'
   #some code that raises a lot of exception
  rescue StandardError
   #handle error
  rescue OtherError
   #handle error
  rescue YetAnotherError
   #handle error
  ???
   print "An error of type #{???} happened, message is #{???}"
  end
  </code></pre>