Clean up exception logs

Clean up output when an exception happens, print more detailed information
about error.