Store exception object rather than it's repr

To make it easier to deal with exceptions and display meaningful error
messages (may not be backwards compatible).