Fixed handling of exceptions, such as socket.timeout. Exceptions do not always have errno or msg, so we need to handle all possible cases.
Merge pull request #2 from mdevaev/master

Fixed handling of exceptions, such as socket.timeout