Fix indentation
Use element 1 (value) instead of type of exception from sys.exc_info