How do I get the type (class)  of exception thrown by any given peice of
code ?

I was playing with sockets and wanted to rescue the "<Errno::E10061: No
connection could be made..." exception.

My dumb way was to try and guess it by looking at the heirarchy tree on Page
93 of PickAxe. After a couple of wrong guesses finally found out it was
RuntimeError. But what if it was none of those (like the TimeoutError)?

Surely, there is a smart (Ruby) way to do this ?

-- shanko