Extract exception message
Python 3.3+ compatible